src/Policies/CategoryPolicy.php
public function view(User $user, Category $category)
    {

        if ($user->canDo('block.category.view') && $user->isAdmin()) {
            return true;
        }

        return $user->id == $category->user_id;
    }
public function view(User $user, Category $category)
    {

        if ($user->canDo('block.category.view') && $user->isAdmin()) {
            return true;
        }

        return $user->id == $category->user_id;
    }
public function view ( User $ user , Category $ category ) { if ( $ user -> canDo ( 'block.category.view' ) && $ user -> isAdmin ( ) ) { return true ; } return $ user -> id == $ category -> user_id ; }
Determine if the given user can view the category.

@param User $user
@param Category $category

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