model refresh laravel

Solutions on MaxInterview for model refresh laravel by the best coders in the world

showing results for - "model refresh laravel"
Isabella
27 Mar 2018
1$user =new App\Models\User()
2  $user->name = "ali"
3  $user->email = "ali@gmail.com"
4  $user->password = bcrypt("123")
5  $user->save()
6  
7  $user->name  = "mohamad"
8  $user->refresh()
9  
10  
11  echo $user 
12  //output is 
13{  id: 1,
14     name: "ali",
15     email: "ali@gmail.com",
16     email_verified_at: null,
17     password: "$2y$10$MmcGpLe7bN1FhOqpKZKXr.cxndIhWbn.Libs7JpCNDwhDyb5e5mqe",
18     remember_token: null,
19     created_at: "2021-07-14 08:06:59",
20     updated_at: "2021-07-14 08:06:59",
21}
22