mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-20 13:04:48 +00:00
05b1aedda5
# Conflicts: # app/Classes/Modules/Announcements/DataTransferObjects/AnnouncementObject.php # app/Classes/Modules/Segments/ControllersLogic/CreateSegmentLogic.php # app/Classes/Modules/Segments/ControllersLogic/DeleteSegmentLogic.php # app/Classes/Modules/Segments/DataTransferObjects/SegmentObject.php # app/Classes/Modules/Segments/Services/CreatesSegment.php # app/Classes/Modules/Segments/Standards/Rules/CanCreateSegment.php # app/Classes/Modules/Segments/Standards/Rules/CanDeleteSegment.php # app/Classes/Modules/Segments/Standards/Validators/SegmentValidation.php # app/Http/Controllers/Announcements/AssignAnnouncementToSegmentController.php # app/Http/Controllers/Announcements/ListAnnouncementsController.php # app/Http/Controllers/Announcements/RemoveSegmentFromAnnouncementController.php # app/Http/Controllers/Announcements/UpdateAnnouncementController.php # app/Http/Controllers/Segments/CreateSegmentController.php # app/Http/Controllers/Segments/DeleteSegmentController.php # routes/announcement.php # routes/api.php # routes/segment.php # routes/web.php
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));
|
|
|
|
}
|
|
|
|
} |