Hello , I have a problem using the get function id ( $ user- > id ) . This function instead of inserting the id come back to me, I always returns 1 . I specify that my primary key is not named id but user_id, I already defined in the User model .
What could it be?
Thank's
May be use follow code
$user = new User;
$user->name = 'demo';
$user->email = 'test@test.com';
$user->save();
$id_after_insert = $user->id;
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community