kdion4891/laravel-livewire-tables

Don't works if model primaryKey is not `id`

Opened this issue · 1 comments

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:
Capture d’écran 2020-09-01 à 19 52 15
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.