In my routes.php file I have :
Route::get(\'/\', function () {
return view(\'login\');
});
Route::get(\'/index\', function(){
return v
#config/app.php
'aliases' => [
...
'Input' => Illuminate\Support\Facades\Input::class,
...
],
#Use Controller file
use Illuminate\Support\Facades\Input;
==OR==
use Input;
Read full example: https://devnote.in/laravel-class-input-not-found
if You use Laravel version 5.2 Review this: https://laravel.com/docs/5.2/requests#accessing-the-request
use Illuminate\Http\Request;//Access able for All requests
...
class myController extends Controller{
public function myfunction(Request $request){
$name = $request->input('username');
}
}
'Input' => Illuminate\Support\Facades\Input::class, add it to App.php.
For laravel < 5.2:
Open config/app.php and add the Input class to aliases:
'aliases' => [
// ...
'Input' => Illuminate\Support\Facades\Input::class,
// ...
],
For laravel >= 5.2
Change Input:: to Request::
It's changed in laravel 6. See for more info here
Don't do anything in app.php and anywhere else, just replace
input::get() with Request::input()
and
on top where you declare Input,Validator,Hash etc., remove Input and add Request
use something like :
Config,DB,File,Hash,Input,Redirect,Session,View,Validator,Request;
It is Input and not input.
This commit removed Input facade definition from config/app.php hence you have to manually add that in to aliases array as below,
'Input' => Illuminate\Support\Facades\Input::class,
Or You can import Input facade directly as required,
use Illuminate\Support\Facades\Input;