Laravel wstawka z identyfikatorem
$id = DB::table('users')->insertGetId([
'email' => '[email protected]',
'votes' => 0
]);
Jittery Jay
$id = DB::table('users')->insertGetId([
'email' => '[email protected]',
'votes' => 0
]);
DB::table('myTable')->orderBy('id','desc')->first();
$data = User::create(['name'=>'first']);
dd($data->id);
$data->save();
$data->id;
$id = $this->create($data)->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,
]);