$request篇
$url = $request->url();
$url = $request->fullUrl();
$uri = $request->path();
if ($request->is('user/*')) {
}
$method = $request->method();
if ($request->isMethod('post')) {
}
$input = $request->all();
$name = $request->input('user', 'guest');
$name = $request->input('products.0.name');
$query = $request->query();
$name = $request->query('user', 'guest');
$name = $request->name;
$isVip = $request->boolean('isVip');
$input = $request->only(['username', 'password']);
$input = $request->only('username', 'password');
$input = $request->except(['update_time']);
$input = $request->except('update_time');
if ($request->has('name')) {
}
if ($request->has(['name', 'email'])) {
}
if ($request->hasAny(['name', 'email'])) {
}
if ($request->filled('name')) {
}
if ($request->missing('name')) {
}
$request->flash();
$request->flashOnly(['username', 'email']);
$request->flashExcept('password');
$username = $request->old('username');
$name = $request->cookie('name');
$name = Cookie::get('name');
$file = $request->file('photo');
$file = $request->photo;
if ($request->hasFile('photo')) {
}
if ($request->file('photo')->isValid()) {
}
$path = $request->photo->path();
$extension = $request->photo->extension();
$path = $request->photo->store('images');
$path = $request->photo->store('images', 's3');
$path = $request->photo->storeAs('images', 'filename.jpg');
$path = $request->photo->storeAs('images', 'filename.jpg', 's3');
|