I want to get Id of newly added row in database. here is the code:
public function store(Request $request)
{
$me = Translation::save();
return $me->id;
}
Translation extends Facade but this code returns error :
Trying to get property of non-object.
any idea? var_dump($me) returns bool(true)
tricky part is that Translation model contains only 1 column - id
You need to create a new object first in order to save it and retrieve its ID.