Room.php (597B)
1 <?php 2 3 namespace App\Models; 4 5 use Illuminate\Database\Eloquent\Concerns\HasUuids; 6 use Illuminate\Database\Eloquent\Factories\HasFactory; 7 use Illuminate\Database\Eloquent\Model; 8 use Illuminate\Database\Eloquent\Relations\HasMany; 9 10 class Room extends Model 11 { 12 use HasFactory; 13 use HasUuids; 14 15 /** 16 * The attributes that are mass assignable. 17 * 18 * @var array<string> 19 */ 20 protected $fillable = ['name', 'description']; 21 22 /** 23 * Get the cabinets in a room. 24 */ 25 public function cabinets(): HasMany 26 { 27 return $this->hasMany(Cabinet::class); 28 } 29 }