25 lines
578 B
PHP
25 lines
578 B
PHP
<?php
|
|
|
|
namespace App\Resources;
|
|
|
|
use App\Models\Tenant;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class LocalGroupResource extends JsonResource {
|
|
private Tenant $tenant;
|
|
|
|
public function __construct(Tenant $tenant) {
|
|
$this->tenant = $tenant;
|
|
}
|
|
|
|
public function toArray($request) : array {
|
|
return [
|
|
'id' => $this->tenant->id,
|
|
'name' => $this->tenant->name,
|
|
'email' => $this->tenant->email,
|
|
'city' => $this->tenant->city,
|
|
'postalcode'=> $this->tenant->postcode
|
|
];
|
|
}
|
|
}
|