Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Traits/Attributable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Rinvex\Attributes\Traits;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Relation;

trait Attributable
Expand Down Expand Up @@ -70,7 +70,7 @@ public static function bootAttributable()
//});

// Attach dynamic relations to this model
$entityAttributes->each(fn($attribute) => static::resolveRelationUsing($attribute->getAttribute('slug'), function (Model $model) use ($attribute) {
$entityAttributes->each(fn ($attribute) => static::resolveRelationUsing($attribute->getAttribute('slug'), function (Model $model) use ($attribute) {
// Determine the relationship type, single value or collection
$method = $attribute->is_collection ? 'hasMany' : 'hasOne';

Expand Down