<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Utilisateur_Progression extends Model
{
    protected $table = 'utilisateur_progressions';
    public $timestamps = false;
    public $incrementing = false;

    protected $primaryKey = ['ID_Utilisateur', 'ID_Ressource'];

    protected $fillable = [
        'ID_Utilisateur',
        'ID_Ressource',
        'Statut_Exploitation',
        'Est_Favori',
    ];

    protected $casts = [
        'Est_Favori' => 'boolean',
    ];

    public function utilisateur()
    {
        return $this->belongsTo(Utilisateur::class, 'ID_Utilisateur', 'ID_Utilisateur');
    }

    public function ressource()
    {
        return $this->belongsTo(Ressource::class, 'ID_Ressource', 'ID_Ressource');
    }
}
