Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Fixed import namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nasrulhazim committed Jul 27, 2018
1 parent fe155dc commit 96ffe68
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions app/Http/Controllers/Api/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers\Api\Auth;

use App\User;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller;
Expand All @@ -26,22 +26,6 @@ public function __invoke(Request $request)

event(new Registered($user));

$tokenResult = $user->createToken('Personal Access Token');
$token = $tokenResult->token;
$token->save();

return response()->api(
[
'user' => $user,
'access_token' => $tokenResult->accessToken,
'token_type' => 'Bearer',
'expires_at' => \Carbon\Carbon::parse(
$tokenResult->token->expires_at
)->toDateTimeString()
],
'You have successfully registered.',
true,
201
);
return response()->api(null, 'You have successfully registered.', true, 201);
}
}

0 comments on commit 96ffe68

Please sign in to comment.