Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

enzo19's avatar

L5 App\Http\Controllers\Input' not found

i am currently migrating my system from 4.2 to 5 but when i want to validate rules for my input:

$validator = Validator::make(Input::all(), $rules);

i keep getting the error message

App\Http\Controllers\Input' not found

is there any way to solve??

0 likes
16 replies
TerrePorter's avatar

I think it changed to Request::all() instead of Input::all()

1 like
michaeldyrynda's avatar

Is there some way to get PhpStorm to do this @JeffreyWay? Using import class imports the facade class itself, rather than Input. Backslashes throughout look ugly. I wonder if I've misconfigured somehow.

crazymonster's avatar

You trying to get L5 input class, but its not exist in Controllers folder. So, put write path.

Senthilkumar's avatar

Yes i have same problem now add "use input;" solve my problem thank dude....

bestmomo's avatar

@Hamelraj : I think you can add the facade in app.php :

    'aliases' => [
           ...
        'Input'     => Illuminate\Support\Facades\Input::class,
3 likes
kingpabel's avatar

@enzo19 you need to use Input at the top of the class,like that

use Input;

otherwise you need to validate like this

$validator = Validator::make(\Input::all(), $rules);
1 like
abdullah's avatar

In Laravel 5.2, I added below namespace in my controller & it resolved the issue & I have the latest version of Laravel 5.2 as of today (I haven't worked on Laravel 5.3 yet)

use Illuminate\Support\Facades\Input;

3 likes
insight's avatar

Hi Abdullah,

It worked for 5.3 too ...

Thanks

Anes

florenxe's avatar

@abdullah i used like you said but the hasFile method does not exist. How do you check if input has file using that facade?

Please or to participate in this conversation.