src/BaseRepositoryEloquent.php
public function first(array $attributes = null)
    {
        $query = $this->eagerLoadRelations();

        if (!is_null($attributes)) {
            $query = $query->where($attributes);
        }

        return $query->first();
    }
public function first(array $attributes = null)
    {
        $query = $this->eagerLoadRelations();

        if (!is_null($attributes)) {
            $query = $query->where($attributes);
        }

        return $query->first();
    }
public function first ( array $ attributes = null ) { $ query = $ this -> eagerLoadRelations ( ) ; if ( ! is_null ( $ attributes ) ) { $ query = $ query -> where ( $ attributes ) ; } return $ query -> first ( ) ; }
Get the first model or the first model for the given attributes.

@param  array  $attributes
@return \Illuminate\Database\Eloquent\Model|null
Get the first model or the first model for the given attributes .