-
Notifications
You must be signed in to change notification settings - Fork 73
Installation
Installation of this package is through the same standard of all composer packages. You have a choice of either locking onto a version number or using the master version.
If you would like to learn more about the standards I use for version labeling, please review the Standards page in the wiki.
Require this package using composer from command line in your Laravel project directory:
$ composer require "subfission/cas":"^4.0"
All supported Laravel releases perform package auto-discovery. The service provider will be discovered and run as part of this process.
And functional middleware class is provided with this package. The middleware must be registered with Laravel before it can be used.
Add the included middleware to the bootstrap/app.php
file:
->withMiddleware(function (Middleware $middleware) {
$middleware->append(\Subfission\Cas\Middleware\CASAuth::class);
})
Alternatively, you may alias the middleware:
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'cas.auth' => \Subfission\Cas\Middleware\CASAuth::class,
]);
})
Add the included middleware (or leverage your own) to your app/Http/Kernel.php file:
'cas.auth' => 'Subfission\Cas\Middleware\CASAuth::class',
'cas.guest' => 'Subfission\Cas\Middleware\RedirectCASAuthenticated::class',
NOTE: I provided this sample middleware for your usage. If you need a more custom solution, create your middleware and modify these paths accordingly.
The configuration file may be optionally published, but the package can be fully configured through environment variables.