Xboard/app/Http/Controllers/V1/Guest/PlanController.php

26 lines
579 B
PHP
Raw Normal View History

2023-11-17 01:44:01 -05:00
<?php
namespace App\Http\Controllers\V1\Guest;
use App\Http\Controllers\Controller;
2025-01-06 12:20:11 -05:00
use App\Http\Resources\PlanResources;
2023-11-17 01:44:01 -05:00
use App\Models\Plan;
2025-01-06 12:20:11 -05:00
use App\Services\PlanService;
use Auth;
2023-11-17 01:44:01 -05:00
use Illuminate\Http\Request;
class PlanController extends Controller
{
2025-01-06 12:20:11 -05:00
protected $planService;
public function __construct(PlanService $planService)
{
$this->planService = $planService;
}
2023-11-17 01:44:01 -05:00
public function fetch(Request $request)
{
2025-01-06 12:20:11 -05:00
$plan = $this->planService->getAvailablePlans();
return $this->success(PlanResources::collection($plan));
2023-11-17 01:44:01 -05:00
}
}