HEX
Server: LiteSpeed
System: Linux server334.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: richfield (1256)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/richfield/www/vendor/yoeunes/toastr/src/ToastrServiceProvider.php
<?php

/*
 * This file is part of the yoeunes/toastr package.
 * (c) Younes KHOUBZA <younes.khoubza@gmail.com>
 */

namespace Yoeunes\Toastr;

use Flasher\Laravel\Support\ServiceProvider;

class ToastrServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function afterBoot()
    {
        $this->publishes(array(
            __DIR__.'/../config/toastr.php' => config_path('toastr.php'),
        ));
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function afterRegister()
    {
        $this->mergeConfigFrom(
            __DIR__.'/../config/toastr.php',
            'toastr'
        );

        $this->registerToastr();
    }

    /**
     * Get the services provided by the provider.
     *
     * @return string[]
     */
    public function provides()
    {
        return array(
            'toastr',
        );
    }

    /**
     * @return ToastrPlugin
     */
    public function createPlugin()
    {
        return new ToastrPlugin();
    }

    /**
     * @return void
     */
    private function registerToastr()
    {
        $this->app->singleton('toastr', function ($app) {
            $options = $app['config']->get('toastr.options', array());

            return new Toastr($app['flasher.toastr'], $options);
        });

        $this->app->alias('toastr', 'Yoeunes\Toastr\Toastr');
    }
}