Reputation: 299
This is my code
$input = Input::all();
Admin::create(Input::only('username', 'password', 'mobileNumber', 'firstName', 'lastName'));
how to get the ID or the new created admin raw please?
many thanks
Upvotes: 1
Views: 144
Reputation:
The Model::create()
method returns an instance of the model, so something like this should work :
$model = Admin::create(...); // create the model
$id = $model->id; // gets the `id` attribute from the model
Upvotes: 3