<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


use Spatie\Permission\Traits\HasRoles;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Deligoez\LaravelModelHashId\Traits\HasHashId;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class RequestDetail extends Model
{
    /** @use HasFactory<\Database\Factories\UserFactory> */
    use HasFactory, Notifiable, HasHashId, HasRoles, SoftDeletes;

    /**
     * The attributes that are mass assignable.
     *
     * @var list<string>
     */
    protected $guarded = [];

    /**
     * Relations
     */

    // Demande à laquelle appartient ce détail
    public function request()
    {
        return $this->belongsTo(Request::class);
    }

    // Produit du détail
    public function product()
    {
        return $this->belongsTo(Product::class);
    }
}
