vendredi 22 avril 2016

How to get last inserted id using Eloquent::insert()

I am inserting bulk insertions in laravel 5 like this:

$data = array(
    array('name'=>'Jack', 'age'=>'24'),
    array('name'=>'Tom', 'age'=>'37'),
    //...
);

Users::insert($data);

Any idea how to get last inserted id?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire