<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class Device extends Model
{
    protected $fillable = ['client_id','client_user_id','type','brand','model','serial_number','specs','condition','purchase_date','notes'];
    protected $casts    = ['purchase_date'=>'date'];

    public function client()     { return $this->belongsTo(Client::class); }
    public function clientUser() { return $this->belongsTo(ClientUser::class); }
    public function tickets()    { return $this->hasMany(Ticket::class); }
}
