client api

This commit is contained in:
pbao9
2026-02-11 10:08:39 +07:00
parent 458ad0a4cb
commit d59b2a0840
27 changed files with 4369 additions and 28 deletions
+16 -7
View File
@@ -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,