parsaaghayi-backend/app/Http/Resources/User.php
2024-10-13 20:16:08 +03:30

26 lines
604 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
class User extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @return array<int|string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
// اضافه کردن سایر فیلدهای مورد نیاز
'email' => $this->email,
'created_at' => $this->created_at,
];
}
}