在我的routes.php
文件中,我有:
Route::get('/', function () {
return view('login');
});
Route::get('/index', function(){
return view('index');
});
Route::get('/register', function(){
return view('register');
});
Route::post('/register',function(){
$user = new \App\User;
$user->username = input::get('username');
$user->email = input::get('email');
$user->password = Hash::make(input::get('username'));
$user->designation = input::get('designation');
$user->save();
});
我有一张用户注册表格。我也采用形式输入值routes.php
。
但是当我注册用户时出现错误。错误:
FatalErrorException in routes.php line 61:
Class 'input' not found
{{ Form::text('name', Input::old('name'), array('class' => 'form-control')) }}