'integer', 'is_active' => 'boolean', ]; } protected static function booted(): void { static::creating(function (FileCategory $category) { if (empty($category->slug)) { $category->slug = Str::slug($category->name); } }); } public function files(): HasMany { return $this->hasMany(File::class); } public function scopeActive($query) { return $query->where('is_active', true); } public function scopeOrdered($query) { return $query->orderBy('sort_order')->orderBy('name'); } }