dealhub/routes/api/deals.php

15 lines
316 B
PHP

<?php
use App\Http\Resources\DealResource;
use App\Models\Deal;
use App\Queries\ExplorePageDealsQuery;
Route::get('/deals/{deal}', function (Deal $deal) {
return new DealResource(
(new ExplorePageDealsQuery)
->builder()
->where('id', $deal->id)
->first()
);
});