1php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
2
1 protected function registered(Request $request, User $user)
2 {
3 if (!$token = auth()->attempt($request->only(['email', 'password']))) {
4 return abort(401);
5 };
6 return (new UserResource($request->user()))->additional([
7 'meta' => [
8 'token' as $token
9 ],
10
11 ]);
12 }