Basic implementation of payment methods
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user