jeudi 28 avril 2016

Laravel 5, can't get the ID of the just saved model, when using UUID

I'm using Laravel Eloquent for my posts table and using the UUID for my table's primary key. But after saving the model I can't get the ID of it, although all the values are correctly inserted in database.

$post = new App\Post();
$post->uuid  = \Webpatser\Uuid\Uuid::generate();
$post->save();
dd($post->uuid); //return null or 0



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire