<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Book extends Model
{
    use HasFactory, SoftDeletes;
    protected $connection = 'tenant';
    protected $fillable = ['titre', 'auteur', 'edition', 'ISBN', 'description', 'fichier'];

    public function disciplines()
    {
        return $this->belongsToMany(Discipline::class)->withTimestamps();;
    }
    public function utilisateurs()
    {
        return $this->belongsToMany(Utilisateur::class)->withTimestamps();
    }
}
