找不到类别“ Illuminate\Support\Facades\Input” [英] Class 'Illuminate\Support\Facades\Input' not found
问题描述
升级laravel 6时出现错误
I have an error when upgrading laravel 6
Symfony \组件\调试\异常\ FatalThrowableError
(E_ERROR)找不到类 Illuminate\Support\Facades\Input
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'Illuminate\Support\Facades\Input' not found
源代码:
错误:
您能帮忙修复吗我的代码?
推荐答案
如果您使用的是 Laravel 5.2 的版本较少,
if you're using less version of Laravel 5.2
在 config / app.php
中,替换:
'Input' => Illuminate\Support\Facades\Input::class,
或者您可以导入 Input
门面直接根据需要
Or You can import Input
facade directly as required,
use Illuminate\Support\Facades\Input;
在 Laravel 5.2 中,输入::被替换为请求::
In Laravel 5.2 Input:: is replaced with Request::
使用
Request::
添加到Controller或任何其他类的顶部
Add to the top of Controller or any other Class
use Illuminate\Http\Request;
您的情况
$image_tmp = $request->image;
$fileName = time() . '.'.$image_tmp->clientExtension();
Laravel 6X
输入
外观主要与 Request
外观重复,已被删除。如果使用的是 Input :: get
方法,则现在应调用 Request :: input
方法。可以简单地将对Input门面的所有其他调用更新为使用 Request
门面。
Laravel 6X
The Input
facade, which was primarily a duplicate of the Request
facade, has been removed. If you are using the Input::get
method, you should now call the Request::input
method. All other calls to the Input facade may simply be updated to use the Request
facade.
您也可以直接使用$ request
You can directly use $request as well
$request->all();
这篇关于找不到类别“ Illuminate\Support\Facades\Input”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!