src/BaseRepository.php
public function firstOrFail($columns = ['*'])
    {
        $result = $this->query()->first($columns);

        if ( ! empty($result)) return $result;

        throw (new ModelNotFoundException)->setModel($this->model());
    }
public function firstOrFail($columns = ['*'])
    {
        $result = $this->query()->first($columns);

        if ( ! empty($result)) return $result;

        throw (new ModelNotFoundException)->setModel($this->model());
    }
public function firstOrFail ( $ columns = [ '*' ] ) { $ result = $ this -> query ( ) -> first ( $ columns ) ; if ( ! empty ( $ result ) ) return $ result ; throw ( new ModelNotFoundException ) -> setModel ( $ this -> model ( ) ) ; }
Returns first match or throws exception if not found

@param  array $columns
@return Model
@throws ModelNotFoundException
Returns first match or throws exception if not found