28 خطوط
760 B
PHP
28 خطوط
760 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class NotificationResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'type' => $this->type,
|
|
'title' => $this->title,
|
|
'body' => $this->body,
|
|
'data' => $this->data,
|
|
'message' => $this->title,
|
|
'notifiable_type' => $this->notifiable_type,
|
|
'notifiable_id' => $this->notifiable_id,
|
|
'is_read' => $this->is_read,
|
|
'read_at' => $this->read_at,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
];
|
|
}
|
|
}
|