Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
railken committed Apr 5, 2024
1 parent 2ff38a5 commit 6c7fa02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Providers/RelationSchemaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public function boot()
{
parent::boot();

app('eloquent.mapper')->boot();

RelationSchema::observe(RelationSchemaObserver::class);

app('amethyst.relation-schema')->boot();
Expand Down
1 change: 1 addition & 0 deletions src/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function define(RelationSchema $relationSchema)
$foreignKey = $payload->get('foreignKey', $relationSchema->name."_id");
$method = $this->getName();

//print_r("Defining... {$relationSchema->data}{$relationSchema->name}:$method:{$payload->require('target')}\n");
return $model->$method(
$target,
$foreignKey
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/MorphToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function define(RelationSchema $relationSchema)

if ($payload->get('inversedBy')) {
app('eloquent.mapper')->addInversedRelation(
$data,
$this->getInstanceModelByName($relationSchema->data),
$target,
$relationSchema->name,
$payload->get('inversedBy')
Expand Down

0 comments on commit 6c7fa02

Please sign in to comment.