I need to retu an object of class User in laravel 5.2 but all I get is 'Undefined variable: user' and I am sure that I am logged and there is an instance of the User. The code is:
$name = 'Random';
$this->createCustomer($name);
dd($user);
public function createCustomer($name) {
$user = Auth::user();
$user ->name = $name
retu $user;
}
All I get at the end is 'Undefined variable: user'
Thanks for your help
