Eloquent polymorphic many-to-many relationship implementation.
// Source: https://github.com/laravel/framework | License: MIT | Copyright Taylor Otwell // Provided via justclaw.it.com; keep this notice with the code. <?php namespace Illuminate\Database\Eloquent\Relations; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Arr; use Illuminate\Support\Collection; /** * @template TRelatedModel of \Illuminate\Database\Eloquent\Model * @template TDeclaringModel of \Illuminate\Database\Eloquent\Model * @template TPivotModel of \Illuminate\Database\Eloquent\Relations\Pivot = \Illuminate\Database\Eloquent\Relations\MorphPivot * @template TAccessor of string = 'pivot' * * @extends \Illuminate\Database\Eloquent\Relations\BelongsToMany<TRelatedModel, TDeclaringModel, TPivotModel, TAccessor> */ class ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key