style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
+19 -4
View File
@@ -1,12 +1,27 @@
<?php
namespace Modules\Categories\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class Category extends Model
{
protected $fillable = ['parent_id','name','slug','description','type','sort_order','is_active'];
protected function casts(): array { return ['is_active'=>'boolean','sort_order'=>'integer']; }
public function parent(): BelongsTo { return $this->belongsTo(self::class, 'parent_id'); }
public function children(): HasMany { return $this->hasMany(self::class, 'parent_id')->orderBy('sort_order'); }
protected $fillable = ['parent_id', 'name', 'slug', 'description', 'type', 'sort_order', 'is_active'];
protected function casts(): array
{
return ['is_active' => 'boolean', 'sort_order' => 'integer'];
}
public function parent(): BelongsTo
{
return $this->belongsTo(self::class, 'parent_id');
}
public function children(): HasMany
{
return $this->hasMany(self::class, 'parent_id')->orderBy('sort_order');
}
}