mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
25 lines
507 B
PHP
Executable File
25 lines
507 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Classes\ControllersLogic\Companies\AddressBook;
|
|
|
|
use App\Models\Company;
|
|
use App\Http\Resources\AddressBook as AddressBookResource;
|
|
|
|
class DeleteAddress
|
|
{
|
|
public function execute(string $companyId, string $id) {
|
|
|
|
// Get address
|
|
$address = Company::findOrfail($companyId)->addressBook()->findOrFail($id);
|
|
|
|
|
|
if($address->delete()){
|
|
|
|
// Return single address as a resource
|
|
return new AddressBookResource($address);
|
|
|
|
}
|
|
|
|
}
|
|
}
|