yoeunes / toastr

:eyes: toastr.js notifications for Laravel
https://php-flasher.io
MIT License
375 stars 52 forks source link

Add blade directives in boot method #11

Closed a21ns1g4ts closed 5 years ago

a21ns1g4ts commented 5 years ago

I can't get render blade directives in many causes. In docs i can see: Blade directive need to be registered in boot method. I can resolve my trouble whit this.

a21ns1g4ts commented 5 years ago
 public function boot()
    {
        $source = realpath($raw = __DIR__.'/../config/toastr.php') ?: $raw;

        if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
            $this->publishes([$source => config_path('toastr.php')]);
        } elseif ($this->app instanceof LumenApplication) {
            $this->app->configure('toastr');
        }

        $this->mergeConfigFrom($source, 'toastr');

        $this->registerBladeDirectives();
    }

https://laravel.com/docs/5.7/blade#custom-if-statements

yoeunes commented 5 years ago

Hello @Atiladanvi, your feedback was taken into consideration, please update to v1.1.1 version. Thanks for reporting this!