<input type="text" name="user" value="User1"> <!-- User1 существует -->
public function postDoSomething(Request $request, User $user)
{
dd($user); //пустой объект
dd($request->user) // "User1"
}
<input type="text" name="user">
public function postDoSomething(Request $request, User $user)
{
dd($user); //пустой объект
}
$this->validate($request, [
'project_id' => 'exists:projects,id',
'user_name' => 'exists:users,name|user_exists_in_project:'.$request->project_id,
]);
public function getRemoveMember(Request $request)
{
$this->validate($request, [
'project_id' => 'exists:projects,id',
'user_name' => 'exists:users,name|user_exists_in_project',
]);
}