Php laravel创建数据库并获取ID

Php laravel创建数据库并获取ID,php,laravel,laravel-4,Php,Laravel,Laravel 4,这是我的密码 $input = Input::all(); Admin::create(Input::only('username', 'password', 'mobileNumber', 'firstName', 'lastName')); 如何获得ID或新创建的管理员原始请 非常感谢方法Model::create()返回模型的实例,因此类似这样的方法应该可以工作: $model = Admin::create(...); // create the model $id

这是我的密码

        $input = Input::all();
Admin::create(Input::only('username', 'password', 'mobileNumber', 'firstName', 'lastName'));
如何获得ID或新创建的管理员原始请

非常感谢方法
Model::create()
返回模型的实例,因此类似这样的方法应该可以工作:

$model = Admin::create(...); // create the model

$id = $model->id; // gets the `id` attribute from the model