src/Eloquent/BaseRepository.php
public function firstOrCreate(array $attributes = [])
    {
        $this->applyCriteria();
        $this->applyScope();

        $model = $this->model->firstOrCreate($attributes);
        $this->resetModel();

        return $this->parserResult($model);
    }
public function firstOrCreate(array $attributes = [])
    {
        $this->applyCriteria();
        $this->applyScope();

        $model = $this->model->firstOrCreate($attributes);
        $this->resetModel();

        return $this->parserResult($model);
    }
public function firstOrCreate ( array $ attributes = [ ] ) { $ this -> applyCriteria ( ) ; $ this -> applyScope ( ) ; $ model = $ this -> model -> firstOrCreate ( $ attributes ) ; $ this -> resetModel ( ) ; return $ this -> parserResult ( $ model ) ; }
Retrieve first data of repository, or create new Entity

@param array $attributes

@return mixed
Retrieve first data of repository or create new Entity