我尝试使用User::create[]
方法创建新用户时出现问题。Laravel ::创建方法
我读Laravel create method这个问题,但它并不能帮助我:
下面是我的用户模型:
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
protected $fillable = [
'name', 'email', 'password','phone','rating'
];
protected $hidden = [
'password', 'remember_token',
];
}
在这里,我的控制器代码:
public function create() {
$input = Request::all();
User::create[$input];
return $input;
}
PhpShtorm显示我此通知:
不断创建未找到...
我该如何解决这个问题,并创建新的用户?
'用户::创建($输入);'创建不是数组它是一种方法。 –
http://i.imgur.com/b7cGcKo。png –
@HakanSONMEZ请在回答中加上你提到的,因为它正确回答。 –