PHP 버전은 8.3.13

jenssegers/blade 버전은 2.0

 

 

설치

composer require jenssegers/blade

 

 

 

이렇게 사용하려는데

use Jenssegers\Blade\Blade;
 
$blade = new Blade('views', 'cache');
 
echo $blade->make('homepage', ['name' => 'John Doe'])->render();

 

 

 

아래와 같은 에러가 발생한다면,

Illuminate\Contracts\Container\BindingResolutionException: Target class [blade.compiler] does not exist

 

 

vendor/jenssegers/blade/src/Blade.php의 Blade::__construct() 에서 아래처럼 수정해주면 됨.

// 에러
$this->container = $container ?: new Container;
 
// 정상
$this->container = $container ?: Container::getInstance();

 

 

 

 

Posted by bloodguy
,