iwannamaybe / phpcas
PhpCas client for the Laravel Framework
1.0.14
2021-03-26 10:03 UTC
Requires
- php: >=7.0.0
- ext-dom: *
- illuminate/http: ^5.5
- illuminate/routing: ^5.5
- illuminate/support: ^5.5
- symfony/translation: ~2.6 || ~3.0 || ^4.0
Requires (Dev)
- illuminate/config: ^5.0,<=5.8
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2025-02-26 18:58:42 UTC
README
About Laravel
PhpCas client for the Laravel Framework 5.5.
Author
Yanghaiquan
Usage
create auth middleware then set the handle method like this:
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
PhpCas::handLogoutRequest();
return PhpCas::checkAuthentication($request,$next,function ($userId){
$user = User::firstOrNew(['mobile' => $userId],['password' => bcrypt(123456)]);
return Auth::loginUsingId($user->id);
});
}
License
The Laravel framework is open-sourced software licensed under the MIT license.