public function resolveRouteBinding($value, $field = null)
{
if (auth()->check()){
if (!Auth::user()->is_admin()) {
return $this->where('user_id', Auth::id())->where($field ?? $this->getRouteKeyName(), $value)->first();
}
}
return $this->where($field ?? $this->getRouteKeyName(), $value)->first();
}
Last active
January 15, 2021 09:24
-
-
Save huzaifa-a/57ca85c14f7bf23357c06ecffb347296 to your computer and use it in GitHub Desktop.
Resolve model binding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment