BelongsOrMorphsToMany
 trait Winter\Storm\Database\Relations\Concerns\BelongsOrMorphsToManyProperties
            
            
            
                public
            
            
            $countMode
            
                :
                                                            bool
                                                                        
                        = false
                    
                            
        
        
        This relation object is a 'count' helper.
            
            
            
                public
            
            
            $orphanMode
            
                :
                                                            bool
                                                                        
                        = false
                    
                            
        
        
        When a join is not used, don't select aliased columns.
Methods
            
            
            
                public
            
                        
            __construct (Winter\Storm\Database\Builder $query, Winter\Storm\Database\Model $parent, string $table, string $foreignPivotKey, string $relatedPivotKey, $parentKey, $relatedKey, string $relationName = null)
                            : void
                    
        
        Create a new belongs to many relationship instance.
| Property | Type | Description | 
|---|---|---|
| $query | Winter\Storm\Database\Builder | Winter\Storm\Database\Builder | 
| $parent | Winter\Storm\Database\Model | Winter\Storm\Database\Model | 
| $table | string | string | 
| $foreignPivotKey | string | string | 
| $relatedPivotKey | string | string | 
| $parentKey | mixed | mixed | 
| $relatedKey | mixed | mixed | 
| $relationName | string | string | 
            
            
            
                public
            
                        
            add (Illuminate\Database\Eloquent\Model $model, $sessionKey = null, array $pivotData = [])
                    
        
        Adds a model to this relationship type.
| Property | Type | Description | 
|---|---|---|
| $model | Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Model | 
| $sessionKey | mixed | mixed | 
| $pivotData | array | array | 
            
            
            
                public
            
                        
            allRelatedIds (string $sessionKey = null)
                            : Illuminate\Support\Collection
                    
        
        Get all of the IDs for the related models, with deferred binding support
| Property | Type | Description | 
|---|---|---|
| $sessionKey | string | string | 
            
            
            
                public
            
                        
            attach (mixed $id, array $attributes = [], boolean $touch = true)
                    
        
        Override attach() method of BelongToMany relation.
This is necessary in order to fire 'model.relation.beforeAttach', 'model.relation.afterAttach' events
| Property | Type | Description | 
|---|---|---|
| $id | mixed | mixed | 
| $attributes | array | array | 
| $touch | boolean | boolean | 
            
            
            
                public
            
                        
            create (array $attributes = [], array $pivotData = [], $sessionKey = null)
                    
        
        Create a new instance of this related model with deferred binding support.
| Property | Type | Description | 
|---|---|---|
| $attributes | array | array | 
| $pivotData | array | array | 
| $sessionKey | mixed | mixed | 
            
            
            
                public
            
                        
            detach (Collection | Model | array | null $ids = null, boolean $touch = true)
                            : int | void
                    
        
        Override detach() method of BelongToMany relation.
This is necessary in order to fire 'model.relation.beforeDetach', 'model.relation.afterDetach' events
| Property | Type | Description | 
|---|---|---|
| $ids | Collection | Model | array | null | Collection | Model | array | null | 
| $touch | boolean | boolean | 
public getForeignKey () : string
Get the fully qualified foreign key for the relation.
public getOtherKey () : string
Get the fully qualified "other key" for the relation.
            
            
            
                public
            
                        
            getRelatedIds ($sessionKey = null)
                    
        
        | Property | Type | Description | 
|---|---|---|
| $sessionKey | mixed | mixed | 
public getSimpleValue ()
Helper for getting this relationship simple value, generally useful with form values.
            
            
            
                public
            
                        
            newPivot (array $attributes = [], boolean $exists = false)
                            : Illuminate\Database\Eloquent\Relations\Pivot
                    
        
        Create a new pivot model instance.
| Property | Type | Description | 
|---|---|---|
| $attributes | array | array | 
| $exists | boolean | boolean | 
            
            
            
                public
            
                        
            paginate (integer $perPage = 15, int $currentPage = null, array $columns = ["*"], string $pageName = "page")
                            : Illuminate\Contracts\Pagination\LengthAwarePaginator
                    
        
        Get a paginator for the "select" statement. Complies with Winter Storm.
| Property | Type | Description | 
|---|---|---|
| $perPage | integer | integer | 
| $currentPage | int | int | 
| $columns | array | array | 
| $pageName | string | string | 
            
            
            
                public
            
                        
            remove (Illuminate\Database\Eloquent\Model $model, $sessionKey = null)
                    
        
        Removes a model from this relationship type.
| Property | Type | Description | 
|---|---|---|
| $model | Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Model | 
| $sessionKey | mixed | mixed | 
            
            
            
                public
            
                        
            save (Illuminate\Database\Eloquent\Model $model, array $pivotData = [], $sessionKey = null)
                    
        
        Save the supplied related model with deferred binding support.
| Property | Type | Description | 
|---|---|---|
| $model | Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Model | 
| $pivotData | array | array | 
| $sessionKey | mixed | mixed | 
public setSimpleValue ($value)
Helper for setting this relationship using various expected values. For example, $model->relation = $value;
| Property | Type | Description | 
|---|---|---|
| $value | mixed | mixed | 
            
            
            
                public
            
                        
            simplePaginate (int | null $perPage = null, int | null $currentPage = null, array $columns = ["*"], string $pageName = "page")
                            : Illuminate\Contracts\Pagination\Paginator
                    
        
        Paginate the given query into a simple paginator.
| Property | Type | Description | 
|---|---|---|
| $perPage | int | null | int | null | 
| $currentPage | int | null | int | null | 
| $columns | array | array | 
| $pageName | string | string | 
            
            
            
                public
            
                        
            sync (array $ids, boolean $detaching = true)
                            : array
                    
        
        Override sync() method of BelongToMany relation in order to flush the query cache.
| Property | Type | Description | 
|---|---|---|
| $ids | array | array | 
| $detaching | boolean | boolean | 
            
            
            
                protected
            
                        
            shouldSelect (array $columns = ["*"])
                            : array | string
                    
        
        Get the select columns for the relation query.
| Property | Type | Description | 
|---|---|---|
| $columns | array | array | 
Used by
| Class | Description | 
|---|---|
| BelongsToMany | |
| MorphToMany | Morph To Many relation. |