chore: update composer dependencies to include phppresentation chore: update composer.lock after adding phppresentation feat: create categories migration for category management feat: create templates migration for template storage feat: create template generations migration for tracking template usage feat: create template keys migration for template customization feat: create notifications migration for user notifications feat: update API routes for categories, templates, and user profile management docs: update API documentation to include new endpoints for profile and wallet
35 lines
944 B
PHP
35 lines
944 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Wallet;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
use OpenApi\Attributes as OA;
|
|
|
|
#[OA\Schema(
|
|
schema: 'Wallet',
|
|
properties: [
|
|
new OA\Property(property: 'id', type: 'integer', example: 1),
|
|
new OA\Property(property: 'balance', type: 'integer', example: 500000),
|
|
new OA\Property(property: 'is_active', type: 'boolean', example: true),
|
|
new OA\Property(property: 'created_at', type: 'string', format: 'date-time'),
|
|
]
|
|
)]
|
|
/** @mixin Wallet */
|
|
class WalletResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'balance' => $this->balance,
|
|
'is_active' => $this->is_active,
|
|
'created_at' => $this->created_at?->toIso8601String(),
|
|
];
|
|
}
|
|
}
|