laravel tinker add user

65

laravel tinker add user -

$user = new App\User();
$user->password = Hash::make('the-password-of-choice');
$user->email = '[email protected]';
$user->name = 'My Name';
$user->save();

create user with tinker php laravel -

1) php artisan tinker
  
2) >>> User::create(["name"=> "laravel", "email"=>"[email protected]", "password"=>bcrypt("secret")]);
=> App\Models\User {#4290
   name: "laravel",
   email: "[email protected]",
   updated_at: "2021-04-22 08:23:28",
   created_at: "2021-04-22 08:23:28",
   id: 1,
  }
>>> 

Comments

Submit
0 Comments