Files
backend-mm/app/Http/Controllers/Api/V1/Order/OrderShippingMethodController.php
Mekan1206 7cc0c0e0a6 WIP
2026-04-29 23:45:51 +05:00

28 lines
796 B
PHP

<?php
namespace App\Http\Controllers\Api\V1\Order;
use App\Http\Controllers\Controller;
use App\Models\Ecommerce\Product\Order\Shipping\OrderShippingMethod;
use Illuminate\Http\JsonResponse;
class OrderShippingMethodController extends Controller
{
/**
* Order shipping methods
*/
public function index(): JsonResponse
{
return response()->rest(
OrderShippingMethod::query()->where('is_active', true)
->get(['id', 'name', 'slug', 'price'])
->map(fn ($shippingMethod) => [
'id' => $shippingMethod->id,
'name' => $shippingMethod->name,
'slug' => $shippingMethod->slug,
'price' => $shippingMethod->price,
])
);
}
}