Viewing File: /home/ubuntu/vedadeals-backend-base/app/Http/Resources/BellNotificationResource.php
<?php
namespace App\Http\Resources;
use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;
class BellNotificationResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'bell_notification_id' => $this->bell_notification_id,
'bell_notification_unique_id' => $this->bell_notification_unique_id,
'title' => $this->title,
'description' => $this->description,
'picture' => $this->picture,
'model_unique_id' => $this->model_unique_id,
'action' => $this->action,
'is_seen' => $this->is_seen,
'created_formatted' => Carbon::parse(common_date($this->created_at, $request->timezone, 'd M Y h:i A'))->diffForHumans(),
'updated_formatted' => Carbon::parse(common_date($this->created_at, $request->timezone, 'd M Y h:i A'))->diffForHumans(),
];
}
}
Back to Directory
File Manager