mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Segments\ControllersLogic;
|
|
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
|
|
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
|
use App\Http\Resources\ConstantResource;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class FetchConstantLogic extends AbstractControllerLogic
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function notification():array {
|
|
return [
|
|
'title' => 'Fetch Segment Constant',
|
|
'message' => 'You have successfully retrieved the Segment Constant'
|
|
];
|
|
}
|
|
|
|
|
|
/** @var FetchesConstant */
|
|
private $fetchesConstant;
|
|
|
|
/**
|
|
* FetchConstantLogic constructor.
|
|
* @param FetchesConstant $fetchesConstant
|
|
*/
|
|
public function __construct(FetchesConstant $fetchesConstant)
|
|
{
|
|
$this->fetchesConstant = $fetchesConstant;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
*/
|
|
public function logic(Request $request) : JsonResponse
|
|
{
|
|
|
|
$constant = $this->fetchesConstant->execute(['segment_id' => $request->route('id'), 'reference' => $request->route('reference')]);
|
|
|
|
return $this->resourceResponse(new ConstantResource($constant));
|
|
|
|
}
|
|
|
|
} |