Skip to content

Commit

Permalink
newPivot method is the same as Laravel
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Jul 30, 2024
1 parent 339af87 commit 71ae70b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Database/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,22 +822,6 @@ public function offsetExists($offset): bool
// Pivot
//

/**
* Create a generic pivot model instance.
* @param \Winter\Storm\Database\Model $parent
* @param array $attributes
* @param string $table
* @param bool $exists
* @param string|null $using
* @return \Winter\Storm\Database\Pivot
*/
public function newPivot(EloquentModel $parent, array $attributes, $table, $exists, $using = null)
{
return $using
? $using::fromRawAttributes($parent, $attributes, $table, $exists)
: Pivot::fromAttributes($parent, $attributes, $table, $exists);
}

/**
* Create a pivot model instance specific to a relation.
* @param \Winter\Storm\Database\Model $parent
Expand Down

0 comments on commit 71ae70b

Please sign in to comment.