- add phone resource
This commit is contained in:
20
app/Http/Resources/PhoneResource.php
Normal file
20
app/Http/Resources/PhoneResource.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PhoneResource extends JsonResource
|
||||
{
|
||||
public static $wrap = null;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'number' => $this->phoneNumber,
|
||||
'formattedNumber' => $this->formattedPhoneNumber,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user