i want to overwrite the get function in my Customer Model.
public function get(array $options = [])
{
$user = \Auth::user();
if($user->role_id == 1){
return parent::get();
}else if($user->role_id == 4){
return parent::where("user_id", $user->id)->get();
}else if($user->role_id == 3){
$users = User::where("user_id", $user->id)->get();
return parent::where("user_id", $user->id)->orWhereIn('user_id', $users)->get();
}
}
Is this possible ?