<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Product extends Model {

    public $table = 'products';
    public $primaryKey = 'id';

    protected $fillable = [
        'serial_number',
        'user_id',
        'user_first_name',
        'user_last_name',
        'active',
        'document_path'
    ];

    public function cabinClass(): belongsTo {
        return $this->belongsTo(CabinClass::class);
    }

    public function documents(): hasMany {
        return $this->hasMany(Document::class);
    }
}
