src/Group/GroupRepository.php
public function findOrFail($id, User $actor = null)
    {
        $query = Group::where('id', $id);

        return $this->scopeVisibleTo($query, $actor)->firstOrFail();
    }
public function findOrFail($id, User $actor = null)
    {
        $query = Group::where('id', $id);

        return $this->scopeVisibleTo($query, $actor)->firstOrFail();
    }
public function findOrFail ( $ id , User $ actor = null ) { $ query = Group :: where ( 'id' , $ id ) ; return $ this -> scopeVisibleTo ( $ query , $ actor ) -> firstOrFail ( ) ; }
Find a user by ID, optionally making sure it is visible to a certain
user, or throw an exception.

@param int $id
@param User $actor
@return \Flarum\Group\Group

@throws \Illuminate\Database\Eloquent\ModelNotFoundException
Find a user by ID optionally making sure it is visible to a certain user or throw an exception .