Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;类blade.compiler不存在“;将Laravel从5.7升级到5.8后_Laravel - Fatal编程技术网

&引用;类blade.compiler不存在“;将Laravel从5.7升级到5.8后

&引用;类blade.compiler不存在“;将Laravel从5.7升级到5.8后,laravel,Laravel,我将我的Laravel项目从5.7版升级到5.8版。我修复了一些软件包,但在成功升级后,我检查了我的Laravel项目版本,发现以下错误: 类blade.compiler不存在 根据这一问题: 您需要将您的外观别名从注册扇区更改为引导初始化扇区 在/app/Providers/***Provider.php 并将所有寄存器方法(带facedes)从register()更改为boot() 例如: <?php namespace App\Providers; use Illuminate\

我将我的Laravel项目从5.7版升级到5.8版。我修复了一些软件包,但在成功升级后,我检查了我的Laravel项目版本,发现以下错误:

类blade.compiler不存在

根据这一问题: 您需要将您的外观别名从注册扇区更改为引导初始化扇区

/app/Providers/***Provider.php

并将所有寄存器方法(带facedes)从
register()
更改为
boot()

例如:

<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
use Illuminate\Support\ServiceProvider;

class UserVehiclesProvider extends ServiceProvider {
    /**
     * Register services.
     *
     * @return void
     */

    public function boot() {  ### <= OK HERE
        $this->app->singleton('UserVehicles', UserVehicles::class);
    }

    public function register() {  ### <= BAD WITH FACADES
        $this->app->singleton('UserVehicles', UserVehicles::class);
    }
}

对不起!这对我不起作用。。。。。。
<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
use Illuminate\Support\ServiceProvider;

class UserVehiclesProvider extends ServiceProvider {
    /**
     * Register services.
     *
     * @return void
     */
    public function boot() {}

    public function register() {
        $this->app->bind('UserVehicles', function () { ### <= Use `bind` method
            return new \App\Services\UserVehicles();
        });
    }
}