-
composer.json
Open in GitHub{ // "require": { "php": "^7.3", "ext-json": "*", // "laravel/passport": "^10.0" }, // }
-
app/Models/User/User.php
Open in GitHubuse Illuminate\Foundation\Auth\User as Authenticatable; use Laravel\Passport\HasApiTokens; class User extends Authenticatable { use HasApiTokens; // }
-
config/auth.php
Open in GitHubreturn [ // 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'passport', 'provider' => 'users', 'hash' => false, ], ], // ];
-
app/Providers/AuthServiceProvider.php
Open in GitHubuse Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Laravel\Passport\Passport; class AuthServiceProvider extends ServiceProvider { // public function boot() { // Passport::routes(); Passport::tokensExpireIn(now()->addDays(365)); Passport::refreshTokensExpireIn(now()->addDays(365)); // } }