add refund and event logic
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Events;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class EventResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this->id ?? 0),
|
||||
'event_name' => $this->event_name,
|
||||
'event_category' => $this->event_category,
|
||||
'description' => $this->description,
|
||||
'amount' => (float) ($this->amount ?? 0),
|
||||
'flyer' => $this->flyer,
|
||||
'expiration_date' => optional($this->expiration_date)->format('Y-m-d'),
|
||||
'semester' => $this->semester,
|
||||
'school_year' => $this->school_year,
|
||||
'created_by' => $this->created_by,
|
||||
'created_at' => optional($this->created_at)->toDateTimeString(),
|
||||
'updated_at' => optional($this->updated_at)->toDateTimeString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user