JWT Laravel
php artisan jwt:secret
Joyous Jaguar
php artisan jwt:secret
composer require tymon/jwt-auth
php artisan jwt:secret
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
$ composer require tymon/jwt-auth:dev-develop --prefer-source
protected function registered(Request $request, User $user)
{
if (!$token = auth()->attempt($request->only(['email', 'password']))) {
return abort(401);
};
return (new UserResource($request->user()))->additional([
'meta' => [
'token' as $token
],
]);
}