1、Model中设置
class Post extends Model
{
//set the table
//protected $table = '';
//allow array
protected $fillable = ['title','content']; //allowed
//protected $guarded = []; //not allowed (if empty -> any allow)
}
2、控制器中使用
Post::create(\request(['title','content']));