client api
This commit is contained in:
+16
-7
@@ -1,18 +1,27 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Http\Controllers\Api\Client\ClientController;
|
||||
|
||||
|
||||
|
||||
Route::prefix('v1')->group(function () {
|
||||
Route::get('get-list-product', function () {
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'data' => Product::all()
|
||||
]);
|
||||
})->name('api.user.GetListProduct');
|
||||
// Auth
|
||||
Route::prefix('client')->as('client.')
|
||||
->group(function () {
|
||||
Route::controller(ClientController::class)->group(function () {
|
||||
Route::post('login', 'login')->name('login');
|
||||
Route::post('register', 'register')->name('register');
|
||||
|
||||
Route::group(['middleware' => ['api.auth']], function () {
|
||||
Route::get('me', 'me')->name('me');
|
||||
Route::post('logout', 'logout')->name('logout');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::any('{any}', function () {
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
|
||||
Reference in New Issue
Block a user