Can I change Eloquent model primary key.
I want to set primary key for example admin_id instead of \'id\'?
admin_id
I know I can change table name for m
The primary key variable is case sensitive and must be $primaryKey to work.
$primaryKey
Example:
protected $primaryKey = 'your_primary_key_id';
Example within a Model class:
class User extends Eloquent { protected $primaryKey = 'your_primary_key_id'; }