php 外观不实现getFacadeAccessor方法

yizd12fk  于 2023-01-08  发布在  PHP
关注(0)|答案(4)|浏览(135)

我得到这个错误信息后,试图降级laravel 9到8,因为我最近降级我的php版本从8到7. 3

In Facade.php line 178:
                                                   
Facade does not implement getFacadeAccessor method.  
                                                   

Script @php artisan package:discover --ansi handling the post-autoload-dump even
returned with error code 1
dw1jzc5e

dw1jzc5e1#

config/app.php中替换

'aliases' => Facade::defaultAliases()->merge([ ])->toArray(),

与:

'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Arr' => Illuminate\Support\Arr::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
        'Bus' => Illuminate\Support\Facades\Bus::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'Date' => Illuminate\Support\Facades\Date::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Http' => Illuminate\Support\Facades\Http::class,
        'Js' => Illuminate\Support\Js::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Notification' => Illuminate\Support\Facades\Notification::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        // 'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'Str' => Illuminate\Support\Str::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class,
    ],
gab6jxml

gab6jxml2#

在我的情况下,错误开始出现后,运行Laravel Shift从8.x升级到9.x,其中我执行了composer install而不是composer update
然后,我删除了vendor文件夹并运行composer update
现在一切都好了。

czfnxgou

czfnxgou3#

运行Laravel Shift后我也是如此。您可能对使用旧版本的Illumination/Support有依赖性。
您必须使用illumination/support版本〉= 9
只需在composer.json中添加或更新以下行:
第一个月

sbtkgmzw

sbtkgmzw4#

那是因为你忘了跑
php工匠用户界面--auth
在 composer 要求laravel/ui之后

相关问题