我正面临以下错误,当我尝试创建数据到数据库中时: [2014-09-27 09:02:40] production.ERROR:exception'Illuminate \ Database \ Eloquent \在电子商务MassAssignmentException”有消息 '名':\网络\ XAMPP \ htdocs中\ laravel \引导\ compiled.php:6397laravel 4.2未创建到数据库中
在new.blade.php文件:
@extends('layouts.default')
@section('content')
<h1>New Author page</h1>
{{ Form::open(array('url' => 'authors/create', 'method' => 'POST')) }}
<p>
{{ Form::label('name', 'Name:') }}
{{ Form::text('name') }}
</p>
<p>
{{ Form::label('bio', 'Biography:') }}
{{ Form::textarea('bio') }}
</p>
<p>
{{ Form::submit('Add Author') }}
</p>
{{ Form::close() }}
@endsection
和routes.php文件我的路线设置为:
Route::get('authors', array('uses'=>'[email protected]', 'as'=>'authors'));
Route::post('authors/create', array('uses'=>'[email protected]', 'as'=>'create_author'));
在我Authorscontroller.php文件以下等为代码:
public function create()
{
Author::create(array(
'name' => Input::get('name'),
'bio' => Input::get('bio')
));
return Redirect::route('authors');
}
这里是版本4.2 laravel问题?
可能重复[Laravel 4照亮\数据库\雄辩\ MassAssignmentException错误](http://stackoverflow.com使用质量分配/ questions/22747061/laravel-4-illuminate-database-eloquent-massassignmentexception-error) – Marwelln 2014-09-27 10:22:53