Skip to content

Commit

Permalink
Format code with prettier, standardjs and php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] committed Sep 1, 2022
1 parent cfd4a65 commit 1b24764
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/Api/AuthTokensController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class AuthTokensController extends Controller
{

public function store(Request $request)
{
$request->validate([
Expand All @@ -27,11 +26,12 @@ public function store(Request $request)
return response()->json([
'token' => $token->plainTextToken,
'user' => $user,
],201);
], 201);
}
return response()->json([
'message' => 'Invalid Credentials'],401
return response()->json(
[
'message' => 'Invalid Credentials'],
401
);
}
}

5 changes: 3 additions & 2 deletions app/Http/Controllers/Api/BooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

class BooksController extends Controller
{
public function __construct(){
$this->middleware('auth:sanctum')->except('index','show');
public function __construct()
{
$this->middleware('auth:sanctum')->except('index', 'show');
}
/**
* Display a listing of the resource.
Expand Down
5 changes: 2 additions & 3 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
return $request->user();
});

Route::apiResource('books',BooksController::class);
Route::post('auth/tokens',[AuthTokensController::class,'store']);

Route::apiResource('books', BooksController::class);
Route::post('auth/tokens', [AuthTokensController::class,'store']);

0 comments on commit 1b24764

Please sign in to comment.