In my routes.php
file I have :
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();
});
I have a form for users registration. I am also taking the form inputs value in the routes.php
.
But the error comes up when I register a user . Error:
FatalErrorException in routes.php line 61:
Class 'input' not found
It is
Input
and notinput
. This commit removedInput
facade definition fromconfig/app.php
hence you have to manually add that in toaliases
array as below,Or You can import
Input
facade directly as required,For laravel
<
5.2:Open
config/app.php
and add theInput
class toaliases
:For laravel
>=
5.2Change
Input::
toRequest::
'Input' => Illuminate\Support\Facades\Input::class
, add it to App.php.Miscall of Class it should be ‘Input’ not ‘input’
Declaration in config/app.php under aliases:-
Or You can import Input facade directly as required,
or