Answers for "laravel get created user id"

PHP
1

laravel 6 get user id

$id = \Auth::id();
Posted by: Guest on December-22-2020
-1

laravel create get id

$id = $this->create($data)->id;
Posted by: Guest on September-03-2020
-1

laravel create get id

$user = User::create([
    'username' => $data['username'] . ' ' . $data['username2'],
    'mail' => $data['mail'],
    'password' => bcrypt($data['password']),
]);

$userInfo = UserInformation::create([
    'user_id' => $user->id,
    'current_food' => $food,
    'current_level' => $level,
]);
Posted by: Guest on September-03-2020

Browse Popular Code Answers by Language