<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ChatMessage extends Model
{
    protected $fillable = [
        'ride_id', 'sender_id', 'sender_name', 'sender_type',
        'message_type', 'content', 'image_url',
        'latitude', 'longitude', 'is_read',
    ];

    protected $casts = [
        'latitude' => 'float', 'longitude' => 'float',
        'is_read' => 'boolean',
    ];

    public function ride() { return $this->belongsTo(Ride::class); }
}
