public function view(UserPolicy $user, Blog $blog)
    {
        if ($user->canDo('blog.blog.view') && $user->isAdmin()) {
            return true;
        }

        return $blog->user_id == user_id() && $blog->user_type == user_type();
    }
public function view(UserPolicy $user, Blog $blog)
    {
        if ($user->canDo('blog.blog.view') && $user->isAdmin()) {
            return true;
        }

        return $blog->user_id == user_id() && $blog->user_type == user_type();
    }
public function view ( UserPolicy $ user , Blog $ blog ) { if ( $ user -> canDo ( 'blog.blog.view' ) && $ user -> isAdmin ( ) ) { return true ; } return $ blog -> user_id == user_id ( ) && $ blog -> user_type == user_type ( ) ; }
Determine if the given user can view the blog.

@param UserPolicy $user
@param Blog $blog

@return bool
Determine if the given user can view the blog .