teranode/wn-application-core-plugin

Laravel class loader plugin for Winter CMS

dev-master 2024-05-14 13:23 UTC

This package is auto-updated.

Last update: 2024-10-14 14:07:19 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.