teranode/wn-application-core-plugin

Laravel class loader plugin for Winter CMS

dev-master 2023-02-16 12:57 UTC

This package is auto-updated.

Last update: 2024-04-16 15:29:26 UTC


README

This is an attempt to replace https://github.com/Teranode/winter-laravel-auth-bridge without the need to manually change files in your winter installation. It retains the same classes and aliases used in the application foundation as the auth bridge. The need for the Kernel file has been removed because you can always push your middleware via the boot function.

You can override the default bindings by re-registering the binding in your Plugin.php file

$this->app->singleton('application.core.loader', function ($app) {
    $bindings = new \Application\Core\Classes\Bindings($app, [
        'redis.connection' => [\Illuminate\Redis\Connections\Connection::class, \Illuminate\Contracts\Redis\Connection::class],
    ]);

    $bindings->registerBindings();
});

The first parameter is the application instance, the second parameter is an array of singletons you want to register, and the 3rd parameter is an array of instances you want to register.