I want to store a model id in same table with different column rel_id having a relation with the id column, but the relation hasOne not working, showing this error:
Cannot redeclare App\Models\Employee:supervisor()
class Employee extends Model
{
function supervisor()
{
return $this->hasOne('App\Models\Employee','id', 'supervisor_id');
}
}