Skip to content

Commit

Permalink
feat(ci): add laravel 10 to the test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzarbn committed Oct 11, 2023
1 parent ac2af39 commit b28e1ee
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.0', '8.1', '8.2' ]
laravel-version: [ '^6.0', '^7.0', '^8.0', '^9.0' ]
php-version: [ '8.0', '8.1', '8.2' ]
laravel-version: [ '^6.0', '^7.0', '^8.0', '^9.0', '^10.0' ]
database: [ 'sqlite', 'mysql', 'pgsql' ]
exclude:
- php-version: '8.1'
Expand Down
29 changes: 29 additions & 0 deletions src/Repositories/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,32 @@ public function store(array $attributes): Model
return $entity;
}

public function update(Model $entity, array $attributes): Model
{
$this->beforeUpdate($entity, $attributes)
->beforeSave($entity, $attributes)
->performFill($entity, $attributes)
->performUpdate($entity)
->afterSave($entity)
->afterUpdate($entity);

return $entity;
}

public function performStore(Model $entity): static
{
$entity->save();

return $this;
}

public function performUpdate(Model $entity): static
{
$entity->save();

return $this;
}

public function performFill(Model $entity, array $attributes): static
{
$entity->fill(
Expand All @@ -53,6 +72,11 @@ public function beforeStore(Model $entity, array &$attributes): static
return $this;
}

public function beforeUpdate(Model $entity, array &$attributes): static
{
return $this;
}

public function beforeSave(Model $entity, array &$attributes): static
{
return $this;
Expand All @@ -63,6 +87,11 @@ public function afterStore(Model $entity): static
return $this;
}

public function afterUpdate(Model $entity): static
{
return $this;
}

public function afterSave(Model $entity): static
{
return $this;
Expand Down

0 comments on commit b28e1ee

Please sign in to comment.