Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Jun 26, 2024
2 parents 3794011 + 78cd1bb commit c4f86c7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. This projec

## Unreleased

## [4.1.0] - 2024-06-26

### Added

- [#36](https://github.com/laravel-json-api/eloquent/pull/36) Support Eloquent dynamic relationships.

## [4.0.0] - 2024-03-12

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function fill(Model $model, ?array $identifier): void
{
$name = $this->relationName();

assert(method_exists($model, $name), sprintf(
assert(method_exists($model, $name) || $model->relationResolver($model::class, $name), sprintf(
'Expecting method %s to exist on model %s.',
$name,
$model::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function getRelation(Model $model): EloquentBelongsToMany
{
$name = $this->relationName();

assert(method_exists($model, $name), sprintf(
assert(method_exists($model, $name) || $model->relationResolver($model::class, $name), sprintf(
'Expecting method %s to exist on model %s.',
$name,
$model::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Relations/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function getRelation(Model $model): EloquentHasMany|EloquentMorphMany
{
$name = $this->relationName();

assert(method_exists($model, $name), sprintf(
assert(method_exists($model, $name) || $model->relationResolver($model::class, $name), sprintf(
'Expecting method %s to exist on model %s.',
$name,
$model::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Relations/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function fill(Model $model, ?array $identifier): void
{
$name = $this->relationName();

assert(method_exists($model, $name), sprintf(
assert(method_exists($model, $name) || $model->relationResolver($model::class, $name), sprintf(
'Expecting method %s to exist on model %s.',
$name,
$model::class,
Expand Down
2 changes: 1 addition & 1 deletion src/QueryToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private function getRelation(): EloquentRelation
{
$name = $this->relation->relationName();

assert(method_exists($this->model, $name), sprintf(
assert(method_exists($this->model, $name) || $this->model->relationResolver($this->model::class, $name), sprintf(
'Expecting method %s to exist on model %s',
$name,
$this->model::class,
Expand Down
2 changes: 1 addition & 1 deletion src/QueryToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function getRelation(): EloquentRelation
{
$name = $this->relation->relationName();

assert(method_exists($this->model, $name), sprintf(
assert(method_exists($this->model, $name) || $this->model->relationResolver($this->model::class, $name), sprintf(
'Expecting method %s to exist on model %s',
$name,
$this->model::class,
Expand Down

0 comments on commit c4f86c7

Please sign in to comment.