v1.2.2
- Subcategories can now be reordered within their category — up/down arrow buttons next to "Edytuj" in Admin > Kategorie. The order set there is used everywhere a subcategory list is shown (pickers, admin listings, etc.).
This commit is contained in:
@@ -11,6 +11,6 @@ class Category extends Model
|
||||
{
|
||||
public function subcategories(): HasMany
|
||||
{
|
||||
return $this->hasMany(Subcategory::class);
|
||||
return $this->hasMany(Subcategory::class)->orderBy('sort_order');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[Fillable(['category_id', 'name', 'description', 'default_priority_key'])]
|
||||
#[Fillable(['category_id', 'name', 'description', 'default_priority_key', 'sort_order'])]
|
||||
class Subcategory extends Model
|
||||
{
|
||||
public function category(): BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user