I have journallog and subjournallog tables. When I insert data in the journallog table, I'd like to get the auto-incremented id from it and insert into the subjournallog table. Can someone provide an example of how to do this?
Asked
Active
Viewed 98 times
-1
-
`$user = User::create(['emai' => 'EMAIL', 'password' => 'PASSWORD']);` creates the user and returns it. And I think that `ID` is accessible via `$user->id` – eMad Jan 12 '16 at 16:40
-
Possible duplicate of [Laravel, get last insert id using Eloquent](http://stackoverflow.com/questions/21084833/laravel-get-last-insert-id-using-eloquent) – Josh Jan 12 '16 at 17:14
1 Answers
0
$user = User::create(['emai' => 'EMAIL', 'password' => 'PASSWORD']);
creates the user and returns it.
And ID
is accessible via $user->id

eMad
- 998
- 3
- 13
- 31