Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
forbidals
/
admin_panel
/
app
/
Models
:
Message.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use App\Traits\DateFormatTrait; class Message extends Model { use HasFactory, DateFormatTrait; protected $fillable = ['chat_id', 'sender_id', 'message', 'read_at']; /** * Get all of the attachment for the Message * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function attachment() { return $this->hasMany(Attachment::class); } /** * Get the chat that owns the Message * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function chat() { return $this->belongsTo(Chat::class); } public function getCreatedAtAttribute($value) { return $this->formatDateValue($value); } public function getUpdatedAtAttribute($value) { return $this->formatDateValue($value); } public function getReadAtAttribute($value) { if ($value) { return $this->formatDateValue($value); } return null; } }