-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapi.php
More file actions
57 lines (48 loc) · 1.84 KB
/
api.php
File metadata and controls
57 lines (48 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
use App\Http\Controllers\Api\AdminController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\Auth\AccountController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::controller(AccountController::class)->group(function () {
Route::post("/register", "register");
Route::post("/login", "authenticate");
});
Route::middleware('auth:sanctum')->group(function () {
Route::controller(App\Http\Controllers\DepositController::class)->group(function () {
Route::post("/deposit", "store");
});
});
Route::middleware('auth:sanctum')->group(function () {
Route::controller(AccountController::class)->group(function () {
route::get("/logged", "testLogin");
Route::get("/logout", "invalidate");
Route::get('/profile', "getUser");
Route::post('/profile/update', "updateProfile");
});
Route::middleware("auth.admin")->group(function () {
Route::controller(AdminController::class)->group(function () {
Route::get("/admin", "testAdmin");
Route::get("/admin/profile/get/all", "getAllUser");
Route::get("/admin/profile/get/{id}", "getUser");
Route::post("/admin/profile/update/{id}", "updateUser");
});
});
});
Route::get("/", function (Request $request) {
return [
"app" => "bssj-api",
"health" => "healthy",
"repo" => "https://github.com/stackofsugar/bssj-api/",
"copy" => "(C) 2022 - present BSSJ API Developers"
];
});