Initial commit
This commit is contained in:
20
app/Http/Controllers/Api/PromotionController.php
Normal file
20
app/Http/Controllers/Api/PromotionController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Models\Promotion;
|
||||
|
||||
class PromotionController extends Controller
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$promotions = Promotion::orderBy('sort_order', 'asc')->get();
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'data' => $promotions
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user