-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 9.37
- Nova Version: 4.17
- PHP Version: 8.1
- Database Driver & Version: MySQL 8
- Operating System and Version: Ventura 13
- Browser type and version: Firefox 107
Description:
sortable() isn't working with spatie/laravel-translatable column:
class OrderItem extends Model
{
use HasFactory;
use HasTranslations;
protected $guarded = ['id'];
public array $translatable = ['title'];Text::make(__('Title'), 'title')
->rules('required', 'max:255')
->sortable(),$table->json('title');{
"lt": "A",
"en": "X"
}
Column has sorting in UI, query is changing from asc to desc. but it doesn't sort the data.
Is this a bug? Because I can't pass callback to sortable method for manual order resolving, eg:
->sortable(function ($query) {
$locale = app()->getLocale();
return $query->orderBy('attribute_title->' . $locale);
})Metadata
Metadata
Assignees
Labels
No labels