I have my primaryKey as member_id (not id which is by default in a model) for my table Members. I have done the necessary changes in the model as follows.
class Member extends Model
{
use HasFactory;
public $timestamps = false;
/**
* The primary key for the model.
*
* @var string
*/
protected $primaryKey = 'member_id';
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'string';
public $incrementing = false;
but Member::query() always attach orderby id asc at the end of the query.
So I get errors for unknown column id. I have tried to reorder from my query but in vain as it is always attached at the end of my query.
How can i get the expected result?