Updated: December 30, 2025
Status: ✅ Production Ready
❌ Before: 'sortBy' parameter didn't work (threw undefined variable error)
✅ After: Full support for 'sortBy' and 'sortDirection' parameters
[@livewire](https://github.com/livewire)('aftable', [
'model' => 'App\Models\Transaction',
'columns' => [
['key' => 'date', 'label' => 'Date'],
['key' => 'amount', 'label' => 'Amount'],
['key' => 'category_id', 'relation' => 'category:name', 'label' => 'Category'],
],
'sortBy' => 'date', // ✅ Now works!
'sortDirection' => 'desc', // ✅ Now works!
])
3 new comprehensive guides added:
SORTING_GUIDE.md ⭐ START HERE for sorting
ENHANCED_FEATURES.md - Advanced features
COMPLETE_GUIDE.md - Master reference
Search Box:
Button Group:
[@livewire](https://github.com/livewire)('aftable', [
'model' => 'App\Models\AccountFlow\Transaction',
'columns' => [
['key' => 'date', 'label' => 'Date'],
['key' => 'amount', 'label' => 'Amount'],
['key' => 'description', 'label' => 'Description'],
['key' => 'category_id', 'relation' => 'category:name', 'label' => 'Category'],
['key' => 'account_id', 'relation' => 'account:name', 'label' => 'Account'],
],
'sortBy' => 'date', // Sort by date column
'sortDirection' => 'desc', // Newest first
'records' => 25, // 25 per page
])
| Parameter | Value | Example |
|---|---|---|
sortBy |
column_key | 'sortBy' => 'date' |
sortDirection |
'asc' or 'desc' | 'sortDirection' => 'desc' |
sort |
'asc' or 'desc' | 'sort' => 'desc' (backward compat) |
| Type | Sortable | Example |
|---|---|---|
| Database Column | ✅ | ['key' => 'name'] |
| Relationship | ✅ | ['relation' => 'user:name'] |
| Count | ✅ | ['key' => 'items_count'] |
| JSON | ✅ | ['json' => 'field'] |
| Function | ❌ | ['function' => 'getStatus'] |
| Raw HTML | ❌ | ['raw' => '<button>'] |
| Issue | Solution |
|---|---|
| "Undefined variable $sortBy" | ✅ Fixed - property now defined |
sortBy parameter ignored |
✅ Fixed - now fully supported |
| Sort not working | ✅ Enhanced - better validation |
| Blade rendering error | ✅ Fixed - template improved |
| Poor mobile UI | ✅ Fixed - responsive design |
vendor/artflow-studio/table/
├── docs/
│ ├── SORTING_GUIDE.md (⭐ New - Sorting Guide)
│ ├── ENHANCED_FEATURES.md (⭐ New - Advanced Features)
│ ├── AI_USAGE_GUIDE.md (Quick Guide)
│ ├── USAGE_STUB.md (All Parameters)
│ └── AI_TECHNICAL_REFERENCE.md (Technical Details)
├── src/
│ ├── Http/Livewire/
│ │ └── DatatableTrait.php (✅ Updated)
│ └── resources/views/
│ └── livewire/
│ └── datatable-trait.blade.php (✅ Improved UI)
├── COMPLETE_GUIDE.md (⭐ New - Master Reference)
├── CHANGELOG_V1.5.2.md (⭐ New - What Changed)
└── README.md
Still Single Query Design:
5 minutes: Read this file
15 minutes: Read SORTING_GUIDE.md Quick Start
1 hour: Read ENHANCED_FEATURES.md
Always: Use COMPLETE_GUIDE.md as reference
[@livewire](https://github.com/livewire)('aftable', [
'model' => 'App\Models\Item',
'columns' => [...],
'sortBy' => 'name', // ❌ Threw error
'sortDirection' => 'asc', // ❌ Ignored
])
[@livewire](https://github.com/livewire)('aftable', [
'model' => 'App\Models\Item',
'columns' => [...],
'sortBy' => 'name', // ✅ Works!
'sortDirection' => 'asc', // ✅ Works!
])
For Relationships:
'columns' => [
['key' => 'customer_name', 'relation' => 'customer:name'],
],
'sortBy' => 'customer_name', // Sorts by customer.name
For Counts:
'columns' => [
['key' => 'items_count'], // Auto-detected
],
'sortBy' => 'items_count', // Sorts by COUNT(items)
For Newest First:
'sortBy' => 'created_at',
'sortDirection' => 'desc',
For A-Z Order:
'sortBy' => 'name',
'sortDirection' => 'asc',
✅ Full sortBy parameter support
✅ Better UI/UX
✅ 3 new comprehensive guides
✅ Performance benchmarks
✅ Real-world examples
✅ 100% backward compatible
✅ Production ready
sortBy and sortDirectionStatus: ✅ Ready to Use
Version: 1.5.2+
Updated: December 30, 2025
How can I help you explore Laravel packages today?