<?php namespace App\Models; use App\Models\Device; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; class LocationTransaction extends Model { use HasFactory; /** * The primary key associated with the devices table. * @var string */ protected $primaryKey = 'location_transaction_id'; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $fillable = ['location_transaction_id', 'room_code', 'timestamp_located_since', 'device_id']; public function device() { return $this->belongsTo(Device::class, 'device_id'); } }