ecphp / laravel-cas
A bundle for Laravel, providing authentication against a Central Authentication Service (CAS) server.
2.0.0
2026-01-23 14:53 UTC
Requires
- php: >= 8.1
- ext-dom: *
- ext-simplexml: *
- ecphp/cas-lib: ^3.0
- laravel/framework: ^12
Requires (Dev)
- guzzlehttp/guzzle: ^7.9
- nyholm/psr7: ^1.8
- orchestra/testbench: 10
- phpstan/phpstan-strict-rules: ^1.6
- roave/security-advisories: dev-latest
- symfony/cache: ^6.4 || ^7.1 || ^7.2
- symfony/psr-http-message-bridge: ^6.4 || ^7.1
Suggests
- symfony/psr-http-message-bridge: To bridge between Laravel and PSR HTTP Message
This package is auto-updated.
Last update: 2026-01-23 15:03:03 UTC
README
A CAS bundle for Laravel.
Installation
composer require ecphp/laravel-cas
bootstrap/providers.php
return [
...
EcPhp\LaravelCas\Providers\AppServiceProvider::class,
];
config/auth.php
'guards' => [
'laravel-cas' => [
'driver' => 'laravel-cas',
'provider' => 'laravel-cas',
],
],
'providers' => [
'laravel-cas' => [
'driver' => 'laravel-cas',
],
],
bootstrap/app.php
use EcPhp\LaravelCas\Middleware\CasAuthenticator;
->withMiddleware(function (Middleware $middleware): void {
...
$middleware->web(append: [
CasAuthenticator::class,
]);
})
app/Providers/AppServiceProvider.php
<?php
declare(strict_types=1);
use Illuminate\Contracts\Foundation\Application;
use Psr\Http\Client\ClientInterface;
use GuzzleHttp\Client;
use loophp\psr17\Psr17Interface;
use Nyholm\Psr7\Factory\Psr17Factory;
use loophp\psr17\Psr17;
public function register(): void
{
$this->app->bind(
ClientInterface::class,
function(Application $app): ClientInterface {
//or whatever client you want
return new Client();
}
);
$this->app->bind(
Psr17Interface::class,
function(Application $app): Psr17Interface {
$psr17Factory = new Psr17Factory();
//or whatever psr17 you want
return new Psr17(
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory
);
}
);
}
php artisan vendor:publish --tag=laravel-cas