lundi 22 juillet 2019

Laravel Envoy - Class config does not exist

I'm currently trying to use Laravel Envoy ( https://laravel.com/docs/5.8/envoy ). It works fine but I would like going further by being able to use Illuminate\Foundation\Application class to be able to inject some dependencies into @setup Envoy directive (e.g. retrieve some config or Eloquent models). But I keep getting this error, whatever I tried.

enter image description here

My Envoy.blade.php file:

@servers(['localhost' => '127.0.0.1'])

@include('vendor/autoload.php')

@setup
    $laravelApp = include 'bootstrap/app.php';
    dump(config('database'));
@endsetup

@task('foo', ['on' => 'localhost'])
    ls
@endtask

Any help would be greatly appreciated, thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire