Files
2019-07-18 17:36:36 +08:00

33 lines
809 B
PHP

<?php
namespace App\Classes\Modules\FreightForwarder\Services;
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
use App\Models\ServiceFees;
class DeletesServiceFees
{
/** @var ServiceFees */
private $repository;
/**
* DeletesServiceFees constructor.
* @param ServiceFees $repository
*/
public function __construct(ServiceFees $repository)
{
$this->repository = $repository;
}
public function execute(String $serviceId){
try{
$repository = $this->repository->findOrFail($serviceId);
$repository->delete();
}catch(\Exception $exception){
throw new InternalServerErrorException("Failed to delete Customer Relation because{$exception->getMessage()}");
}
}
}