Skip to content

Commit

Permalink
Merge pull request andersao#694 from ammonkc/master
Browse files Browse the repository at this point in the history
Laravel 7.0 support
  • Loading branch information
andersao authored Mar 10, 2020
2 parents 363904b + 7194cb4 commit 4fa3f6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"docs": "http://andersao.github.io/l5-repository"
},
"require": {
"illuminate/http": "~5.0|~6.0",
"illuminate/config": "~5.0|~6.0",
"illuminate/support": "~5.0|~6.0",
"illuminate/database": "~5.0|~6.0",
"illuminate/pagination": "~5.0|~6.0",
"illuminate/console": "~5.0|~6.0",
"illuminate/filesystem": "~5.0|~6.0",
"illuminate/http": "~5.0|~6.0|~7.0",
"illuminate/config": "~5.0|~6.0|~7.0",
"illuminate/support": "~5.0|~6.0|~7.0",
"illuminate/database": "~5.0|~6.0|~7.0",
"illuminate/pagination": "~5.0|~6.0|~7.0",
"illuminate/console": "~5.0|~6.0|~7.0",
"illuminate/filesystem": "~5.0|~6.0|~7.0",
"prettus/laravel-validation": "~1.1|~1.2"
},
"autoload": {
Expand Down
10 changes: 4 additions & 6 deletions src/Prettus/Repository/Eloquent/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function presenter()
*/
public function validator()
{

if (isset($this->rules) && !is_null($this->rules) && is_array($this->rules) && !empty($this->rules)) {
if (class_exists('Prettus\Validator\LaravelValidator')) {
$validator = app('Prettus\Validator\LaravelValidator');
Expand Down Expand Up @@ -348,7 +347,7 @@ public function count(array $where = [], $columns = '*')
$this->applyCriteria();
$this->applyScope();

if($where) {
if ($where) {
$this->applyConditions($where);
}

Expand Down Expand Up @@ -436,7 +435,7 @@ public function firstOrCreate(array $attributes = [])

return $this->parserResult($model);
}

/**
* Set the "limit" value of the query.
*
Expand Down Expand Up @@ -622,7 +621,7 @@ public function create(array $attributes)
$attributes = $this->model->newInstance()->forceFill($attributes)->makeVisible($this->model->getHidden())->toArray();
} else {
$model = $this->model->newInstance()->forceFill($attributes);
$model->addVisible($this->model->getHidden());
$model->makeVisible($this->model->getHidden());
$attributes = $model->toArray();
}

Expand Down Expand Up @@ -660,7 +659,7 @@ public function update(array $attributes, $id)
$attributes = $this->model->newInstance()->forceFill($attributes)->makeVisible($this->model->getHidden())->toArray();
} else {
$model = $this->model->newInstance()->forceFill($attributes);
$model->addVisible($this->model->getHidden());
$model->makeVisible($this->model->getHidden());
$attributes = $model->toArray();
}

Expand Down Expand Up @@ -989,7 +988,6 @@ protected function applyScope()
*/
protected function applyCriteria()
{

if ($this->skipCriteria === true) {
return $this;
}
Expand Down

0 comments on commit 4fa3f6d

Please sign in to comment.