This commit is contained in:
Mekan1206
2026-04-29 23:35:51 +05:00
parent bc2770c24d
commit 7cc0c0e0a6
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?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,
])
);
}
}