fix: promotion

This commit is contained in:
2026-07-10 09:44:56 +03:30
parent c17c7e6805
commit e9574a4ce0
2 changed files with 15 additions and 0 deletions
@@ -27,6 +27,19 @@ public function index()
return response()->json($promotions);
}
/**
* Admin listing: returns ALL promotions regardless of is_active or the
* start/end window, so admins can see and edit inactive/expired ones.
*/
public function adminIndex()
{
$promotions = Promotion::orderBy('priority', 'desc')
->orderByDesc('id')
->get();
return response()->json($promotions);
}
public function store(Request $request)
{
$data = $request->validate([