25 lines
790 B
PHP
25 lines
790 B
PHP
<?php
|
|
|
|
namespace App\Resources;
|
|
|
|
use App\Models\AvailablePaymentMethod;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AvailablePaymentMethodResource extends JsonResource {
|
|
private AvailablePaymentMethod $availablePaymentMethod;
|
|
|
|
public function __construct(AvailablePaymentMethod $availablePaymentMethod) {
|
|
$this->availablePaymentMethod = $availablePaymentMethod;
|
|
}
|
|
|
|
public function toArray($request) : array {
|
|
return [
|
|
'id' => $this->availablePaymentMethod->id,
|
|
'slug' => $this->availablePaymentMethod->slug,
|
|
'name' => $this->availablePaymentMethod->name,
|
|
'description' => $this->availablePaymentMethod->description,
|
|
'active' => $this->availablePaymentMethod->active,
|
|
];
|
|
}
|
|
}
|