laravel-livewire-tables
laravel-livewire-tables copied to clipboard
Don't works if model primaryKey is not `id`
I've a model, Customer
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Customer extends Model
{
protected $table = 'customer';
protected $primaryKey = 'id_customer';
}
and i've this error:
If i change to key (in the database) to
id
it's working !
I'm issing something ?
Thanks
@PrestaSafe You can easy fix this by adding public $sort_attribute = 'id_customer';
to your table component.