Last active
April 3, 2021 14:21
-
-
Save morrislaptop/49fb7cdbc09110b21aa27e9976b8fc3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Auth::viaRequest('firebase', function ($request) { | |
return app(FirebaseGuard::class)->user($request); | |
}); |
use Illuminate\Support\Facades\Auth;
FirebaseGuard
is just a simple class you have to implement yourself. It can be DI'ed, and the user() function should accept a $request and return a Authenticable object.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
use Auth;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
}
`