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??
I think it changed to Request::all() instead of Input::all()
@enzo19 - Yes, add use Input; to the top of your class.
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.
You trying to get L5 input class, but its not exist in Controllers folder. So, put write path.
Yeah i'm using that too @mikevrind , might have to look into it a bit.
Yes i have same problem now add "use input;" solve my problem thank dude....
@JeffreyWay in Laravel 5.2 use Input; dose't work is rhere any other solution use global Input ?
@Hamelraj : I think you can add the facade in app.php :
'aliases' => [
...
'Input' => Illuminate\Support\Facades\Input::class,
@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);
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;
Hi Abdullah,
It worked for 5.3 too ...
Thanks
Anes
@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 sign in or create an account to participate in this conversation.