feat: add withdraw request functionality and UI components
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Client;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class WalletTransactionResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
'reason' => $this->reason,
|
||||
'amount' => $this->amount,
|
||||
'balance_after' => $this->balance_after,
|
||||
'description' => $this->description,
|
||||
'via_gateway' => $this->payment_id !== null,
|
||||
'invoice_number' => $this->whenLoaded('invoice', fn () => $this->invoice?->number),
|
||||
'created_at' => verta($this->created_at)->format('%Y/%m/%d - H:i'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user