i have 2 type of user with different fields/columns in db (not the users table , users table is the same for both they have different profiles )
so in my registerController.php i have this validation function
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'last_name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
}
which only covers 1 type of user , i need to access to
$request->input('user_type');
in this function so i can run proper validation for each users
i've tried something that used to work in older laravel version
private $request ;
public function __construct(Request $request)
{
$this->middleware('guest');
$this->request = $request ;
}
but in the 5.5 version of laravel it doesn't work i get
Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttp\Psr7\Request