|
@@ 84-90 (lines=7) @@
|
| 81 |
|
return new AbstractRelation(['belongsTo', static::class, $relationName, [$related, $foreignKey, $ownerKey, $relationName]]); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
public static function belongs_to_many($relationName, $related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, |
| 85 |
|
$parentKey = null, $relatedKey = null) |
| 86 |
|
{ |
| 87 |
|
$params = [$related, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName]; |
| 88 |
|
|
| 89 |
|
return new AbstractRelation(['belongsToMany', static::class, $relationName, $params]); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
/** |
| 93 |
|
* Define a polymorphic many-to-many relationship. |
|
@@ 107-114 (lines=8) @@
|
| 104 |
|
* |
| 105 |
|
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
| 106 |
|
*/ |
| 107 |
|
public static function morph_to_many($relationName, $related, $name, $table = null, $foreignPivotKey = null, |
| 108 |
|
$relatedPivotKey = null, $parentKey = null, $relatedKey = null) |
| 109 |
|
{ |
| 110 |
|
$params = [$related, $name, $table, $foreignPivotKey, |
| 111 |
|
$relatedPivotKey, $parentKey, $relatedKey, $relationName]; |
| 112 |
|
|
| 113 |
|
return new AbstractRelation(['morphToMany', static::class, $relationName, $params]); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
/** |
| 117 |
|
* Define a polymorphic one-to-many relationship. |