21 lines
451 B
PHP
21 lines
451 B
PHP
<?php
|
|
|
|
use App\Models\Product;
|
|
|
|
|
|
|
|
Route::prefix('v1')->group(function () {
|
|
Route::get('get-list-product', function () {
|
|
return response()->json([
|
|
'error' => false,
|
|
'data' => Product::all()
|
|
]);
|
|
})->name('api.user.GetListProduct');
|
|
});
|
|
|
|
Route::any('{any}', function () {
|
|
return response()->json([
|
|
'error' => true,
|
|
'message' => 'API Route not found'
|
|
], 404);
|
|
})->where('any', '.*'); |