-
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
OctoberUtil
- ComposerScript
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- ProjectSet
- ProjectSync
- ThemeCheck
- ThemeInstall
- ThemeList
- ThemeRemove
- ThemeSync
- ThemeUse
-
-
Controllers
-
Database
-
Facades
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
resizer
-
router
-
template
-
theme
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
- afterBoot
- afterCreate
- afterDelete
- afterFetch
- afterRestore
- afterSave
- afterUpdate
- afterValidate
- beforeCreate
- beforeDelete
- beforeFetch
- beforeGetAttribute
- beforeRestore
- beforeSave
- beforeSetAttribute
- beforeUpdate
- beforeValidate
- getAttribute
- saveInternal
- setAttribute
-
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
resizer
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
- BaseCssFilter
- CallablesFilter
- CssCacheBustingFilter
- CssImportFilter
- CssMinFilter
- CssRewriteFilter
- FilterCollection
- JavascriptImporter
- JSMinFilter
- JSMinPlusFilter
- JSqueezeFilter
- LessCompiler
- LessphpFilter
- MinifyCssCompressorFilter
- PackagerFilter
- PackerFilter
- ScssCompiler
- ScssphpFilter
- StylesheetMinify
-
Util
- README
- AssetManager
- AssetWriter
- FilterManager
-
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Parsedown
-
Syntax
- Bracket
- Ini
- Markdown
- MarkdownData
- ParseServiceProvider
- Twig
- Yaml
-
-
Process
-
Resize
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Library
- Database
- Relations
- BelongsToMany
October\Rain\Database\Relations\BelongsToMany
Extends:
- Illuminate\Database\Eloquent\Relations\BelongsToMany
- Illuminate\Database\Eloquent\Relations\Relation
BelongsToMany
Public properties
public boolean $countMode
countMode sets this relation object is a 'count' helper
public boolean $orphanMode
orphanMode used when a join is not used, don't select aliased columns
Show inherited public properties
Inherited public properties
- public bool $withTimestamps - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Indicates if timestamps are available on the pivot table.
- public static array $morphMap - defined in Illuminate\Database\Eloquent\Relations\Relation. An array to map class names to their morph names in database.
Protected properties
There are no protected properties in the class.
Show inherited protected properties
Inherited protected properties
- protected string $table - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The intermediate table for the relation.
- protected string $foreignPivotKey - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The foreign key of the parent model.
- protected string $relatedPivotKey - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The associated key of the relation.
- protected string $parentKey - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The key name of the parent model.
- protected string $relatedKey - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The key name of the related model.
- protected string $relationName - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The "name" of the relationship.
- protected array $pivotColumns - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The pivot table columns to retrieve.
- protected array $pivotWheres - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Any pivot table restrictions for where clauses.
- protected array $pivotWhereIns - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Any pivot table restrictions for whereIn clauses.
- protected array $pivotValues - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The default values for the pivot columns.
- protected string $pivotCreatedAt - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The custom pivot table column for the created_at timestamp.
- protected string $pivotUpdatedAt - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The custom pivot table column for the updated_at timestamp.
- protected string $using - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The class name of the custom pivot model to use for the relationship.
- protected string $accessor - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The name of the accessor to use for the "pivot" relationship.
- protected static int $selfJoinCount - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. The count of self joins.
- protected Illuminate\Database\Eloquent\Builder $query - defined in Illuminate\Database\Eloquent\Relations\Relation. The Eloquent query builder instance.
- protected Illuminate\Database\Eloquent\Model $parent - defined in Illuminate\Database\Eloquent\Relations\Relation. The parent model instance.
- protected Illuminate\Database\Eloquent\Model $related - defined in Illuminate\Database\Eloquent\Relations\Relation. The related model instance.
- protected static bool $constraints - defined in Illuminate\Database\Eloquent\Relations\Relation. Indicates if the relation is adding constraints.
- protected static array $macros - defined in Illuminate\Database\Eloquent\Relations\Relation. The registered string macros.
Public methods
public void __construct(Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Model $parent, string $table, string $foreignPivotKey, string $relatedPivotKey, string $relationName, $relatedKey, $relationName=NULL)
Create a new belongs to many relationship instance.
Parameters
- Illuminate\Database\Eloquent\Builder $query
- Illuminate\Database\Eloquent\Model $parent
- string $table
- string $foreignPivotKey
- string $relatedPivotKey
- string $relationName
- $relatedKey
- $relationName
public void add($model, $sessionKey=NULL, $pivotData=array())
add a model to this relationship type.
Parameters
- $model
- $sessionKey
- $pivotData
public void addDefinedConstraints()
Set the defined constraints on the relation query.
public void addDefinedConstraintsToQuery(October\Rain\Database\QueryBuilder $query, array $args=NULL)
Add query based constraints.
Parameters
- October\Rain\Database\QueryBuilder $query
- array $args
public void addDefinedConstraintsToRelation(Illuminate\Database\Eloquent\Relations\Relation $relation, array $args=NULL)
Add relation based constraints.
Parameters
- Illuminate\Database\Eloquent\Relations\Relation $relation
- array $args
public October\Rain\Support\Collection allRelatedIds(string $sessionKey=NULL)
allRelatedIds for the related models, with deferred binding support
Parameters
- string $sessionKey
public void attach(mixed $id, array $attributes=array(), bool $touch=true)
attach overrides attach() method of BelongToMany relation This is necessary in order to fire 'model.relation.beforeAttach', 'model.relation.attach' events
Parameters
- mixed $id
- array $attributes
- bool $touch
public void create($attributes=array(), $pivotData=array(), $sessionKey=NULL)
create a new instance of this related model with deferred binding support.
Parameters
- $attributes
- $pivotData
- $sessionKey
public int|void detach(null $ids=NULL, bool $touch=true)
detach overrides detach() method of BelongToMany relation. This is necessary in order to fire 'model.relation.beforeDetach', 'model.relation.detach' events
Parameters
- null $ids
- bool $touch
public string getForeignKey()
getForeignKey gets the fully qualified foreign key for the relation
public string getOtherKey()
getOtherKey gets the fully qualified "other key" for the relation
public void getSimpleValue()
getSimpleValue is a helper for getting this relationship simple value, generally useful with form values
public Illuminate\Database\Eloquent\Relations\Pivot newPivot(array $attributes=array(), bool $exists=false)
newPivot creates a new pivot model instance
Parameters
- array $attributes
- bool $exists
public Illuminate\Contracts\Pagination\LengthAwarePaginator paginate(int $perPage=15, int $currentPage=NULL, array $columns=array( 0=>'*'), string $pageName='page')
paginate gets a paginator for the "select" statement that complies with October Rain
Parameters
- int $perPage
- int $currentPage
- array $columns
- string $pageName
public void remove($model, $sessionKey=NULL)
remove a model from this relationship type.
Parameters
- $model
- $sessionKey
public void save($model, $pivotData=array(), $sessionKey=NULL)
save the supplied related model with deferred binding support.
Parameters
- $model
- $pivotData
- $sessionKey
public void setSimpleValue($value)
setSimpleValue is a helper for setting this relationship using various expected values. For example, $model->relation = $value;
Parameters
- $value
public void sync($ids, $detaching=true)
sync model IDs and flush the duplicate cache
Parameters
- $ids
- $detaching
public Illuminate\Database\Query\Builder withDeferred($sessionKey)
Returns the model query with deferred bindings added
Parameters
- $sessionKey
Inherited public methods
- public mixed __call(string $method, array $parameters) - defined in Illuminate\Database\Eloquent\Relations\Relation. Handle dynamic method calls to the relationship.
- public static mixed __callStatic(string $method, array $parameters) - defined in Illuminate\Database\Eloquent\Relations\Relation. Dynamically handle calls to the class.
- public void __clone() - defined in Illuminate\Database\Eloquent\Relations\Relation. Force a clone of the underlying query builder when cloning.
- public void addConstraints() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the base constraints on the relation query.
- public void addEagerConstraints(array $models) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the constraints for an eager load of the relation.
- public $this as(string $accessor) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Specify the custom pivot accessor to use for the relationship.
- public bool chunk(int $count, callable $callback) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Chunk the results of the query.
- public bool chunkById(int $count, callable $callback, string|null $column=NULL, string|null $alias=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Chunk the results of a query by comparing numeric IDs.
- public array createMany(iterable $records, array $joinings=array()) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create an array of new instances of the related models.
- public string createdAt() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the name of the "created at" column.
- public Illuminate\Support\LazyCollection cursor() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get a lazy collection for the given query.
- public bool each(callable $callback, int $count=1000) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Execute a callback over each item while chunking.
- public Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null find(mixed $id, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Find a related model by its primary key.
- public Illuminate\Database\Eloquent\Collection findMany(mixed $ids, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Find multiple related models by their primary keys.
- public Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection findOrFail(mixed $id, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Find a related model by its primary key or throw an exception.
- public Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model findOrNew(mixed $id, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Find a related model by its primary key or return new instance of the related model.
- public mixed first(array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Execute the query and get the first result.
- public Illuminate\Database\Eloquent\Model firstOrCreate(array $attributes, array $joining=array(), bool $touch=true) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the first related record matching the attributes or create it.
- public Illuminate\Database\Eloquent\Model|static firstOrFail(array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Execute the query and get the first result or throw an exception.
- public Illuminate\Database\Eloquent\Model firstOrNew(array $attributes) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the first related model record matching the attributes or instantiate it.
- public Illuminate\Database\Eloquent\Model|static firstWhere(Closure|string|array $column, mixed $operator=NULL, mixed $value=NULL, string $boolean='and') - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Add a basic where clause to the query, and return the first result.
- public Illuminate\Database\Eloquent\Collection get(array $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Execute the query as a "select" statement.
- public Illuminate\Database\Query\Builder getBaseQuery() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the base query builder driving the Eloquent builder.
- public Illuminate\Database\Eloquent\Collection getEager() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the relationship for eager loading.
- public string getExistenceCompareKey() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the key for comparing against the parent key in "has" query.
- public string getForeignPivotKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the foreign key for the relation.
- public static string|null getMorphedModel(string $alias) - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the model associated with a custom polymorphic type.
- public Illuminate\Database\Eloquent\Model getParent() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the parent model of the relation.
- public string getParentKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the parent key for the relationship.
- public string getPivotAccessor() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the name of the pivot accessor for this relationship.
- public string getPivotClass() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the class being used for pivot models.
- public array getPivotColumns() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the pivot columns for this relationship.
- public string getQualifiedForeignPivotKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the fully qualified foreign key for the relation.
- public string getQualifiedParentKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the fully qualified parent key name for the relation.
- public string getQualifiedRelatedPivotKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the fully qualified "related key" for the relation.
- public Illuminate\Database\Eloquent\Builder getQuery() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the underlying query for the relation.
- public Illuminate\Database\Eloquent\Model getRelated() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the related model of the relation.
- public string getRelatedKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the related key for the relationship.
- public string getRelatedPivotKeyName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the "related key" for the relation.
- public string getRelationCountHash() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get a relationship join table hash.
- public Illuminate\Database\Eloquent\Builder getRelationExistenceCountQuery(Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery) - defined in Illuminate\Database\Eloquent\Relations\Relation. Add the constraints for a relationship count query.
- public Illuminate\Database\Eloquent\Builder getRelationExistenceQuery(Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array|mixed $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Add the constraints for a relationship query.
- public Illuminate\Database\Eloquent\Builder getRelationExistenceQueryForSelfJoin(Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Builder $parentQuery, array|mixed $columns=array( 0=>'*')) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Add the constraints for a relationship query on the same table.
- public string getRelationName() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the relationship name for the relationship.
- public mixed getResults() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the results of the relationship.
- public string getTable() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the intermediate table for the relationship.
- public static bool hasMacro(string $name) - defined in Illuminate\Database\Eloquent\Relations\Relation. Checks if macro is registered.
- public bool hasPivotColumn(string $column) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Determine whether the given column is defined as a pivot column.
- public array initRelation(array $models, string $relation) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Initialize the relation on a set of models.
- public static void macro(string $name, object|callable $macro) - defined in Illuminate\Database\Eloquent\Relations\Relation. Register a custom macro.
- public mixed macroCall(string $method, array $parameters) - defined in Illuminate\Database\Eloquent\Relations\Relation. Dynamically handle calls to the class.
- public array match(array $models, Illuminate\Database\Eloquent\Collection $results, string $relation) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Match the eagerly loaded results to their parents.
- public static void mixin(object $mixin, bool $replace=true) - defined in Illuminate\Database\Eloquent\Relations\Relation. Mix another object into the class.
- public static array morphMap(array|null $map=NULL, bool $merge=true) - defined in Illuminate\Database\Eloquent\Relations\Relation. Set or get the morph map for polymorphic relations.
- public Illuminate\Database\Eloquent\Relations\Pivot newExistingPivot(array $attributes=array()) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create a new existing pivot model instance.
- public Illuminate\Database\Query\Builder newPivotQuery() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create a new query builder for the pivot table.
- public Illuminate\Database\Query\Builder newPivotStatement() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get a new plain query builder for the pivot table.
- public Illuminate\Database\Query\Builder newPivotStatementForId(mixed $id) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get a new pivot statement for a given "other" ID.
- public static mixed noConstraints(Closure $callback) - defined in Illuminate\Database\Eloquent\Relations\Relation. Run a callback with constraints disabled on the relation.
- public $this orWherePivot(string $column, string|null $operator=NULL, mixed $value=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set an "or where" clause for a pivot table column.
- public $this orWherePivotIn(string $column, mixed $values) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set an "or where in" clause for a pivot table column.
- public $this orWherePivotNotIn(string $column, mixed $values) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set an "or where not in" clause for a pivot table column.
- public int rawUpdate(array $attributes=array()) - defined in Illuminate\Database\Eloquent\Relations\Relation. Run a raw update against the base query.
- public string relatedUpdatedAt() - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the name of the related model's "updated at" column.
- public array saveMany(Illuminate\Support\Collection|array $models, array $pivotAttributes=array()) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Save an array of new models and attach them to the parent model.
- public Illuminate\Contracts\Pagination\Paginator simplePaginate(int|null $perPage=NULL, array $columns=array( 0=>'*'), string $pageName='page', int|null $page=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Paginate the given query into a simple paginator.
- public array syncWithoutDetaching(Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Sync the intermediate tables with a list of IDs without detaching.
- public array toggle(mixed $ids, bool $touch=true) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Toggles a model (or models) from the parent.
- public void touch() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Touch all of the related models for the relationship.
- public void touchIfTouching() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. If we're touching the parent model, touch.
- public int updateExistingPivot(mixed $id, array $attributes, bool $touch=true) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Update an existing pivot record on the table.
- public Illuminate\Database\Eloquent\Model updateOrCreate(array $attributes, array $values=array(), array $joining=array(), bool $touch=true) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create or update a related record matching the attributes, and fill it with values.
- public string updatedAt() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the name of the "updated at" column.
- public $this using(string $class) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Specify the custom pivot model to use for the relationship.
- public $this wherePivot(string $column, string|null $operator=NULL, mixed $value=NULL, string $boolean='and') - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set a where clause for a pivot table column.
- public $this wherePivotIn(string $column, mixed $values, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set a "where in" clause for a pivot table column.
- public $this wherePivotNotIn(string $column, mixed $values, string $boolean='and') - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set a "where not in" clause for a pivot table column.
- public $this withPivot(array|mixed $columns) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the columns on the pivot table to retrieve.
- public $this withPivotValue(string|array $column, mixed $value=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set a where clause for a pivot table column.
- public $this withTimestamps(mixed $createdAt=NULL, mixed $updatedAt=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Specify that the pivot table has creation and update timestamps.
Protected methods
protected Illuminate\Database\Query\Expression getWithDeferredQualifiedKeyName()
Returns the related "slave id" key in a database friendly format.
protected Illuminate\Database\Eloquent\Relations\BelongsToMany shouldSelect($columns=array( 0=>'*'))
shouldSelect gets the select columns for the relation query
Parameters
- $columns
Show inherited protected methods
Inherited protected methods
- protected array addTimestampsToAttachment(array $record, bool $exists=false) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the creation and update timestamps on an attach record.
- protected $this addWhereConstraints() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the where clause for the relation query.
- protected array aliasedPivotColumns() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the pivot columns for the relation.
- protected array attachNew(array $records, array $current, bool $touch=true) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Attach all of the records that aren't in the given current records.
- protected void attachUsingCustomClass(mixed $id, array $attributes) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Attach a model to the parent using a custom class.
- protected array baseAttachRecord(int $id, bool $timed) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create a new pivot attachment record.
- protected array buildDictionary(Illuminate\Database\Eloquent\Collection $results) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Build model dictionary keyed by the relation's foreign key.
- protected static array|null buildMorphMapFromModels(array $models=NULL) - defined in Illuminate\Database\Eloquent\Relations\Relation. Builds a table-keyed array from model class names.
- protected array castAttributes(array $attributes) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Cast the given pivot attributes.
- protected mixed castKey(mixed $key) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Cast the given key to convert to primary key type.
- protected array castKeys(array $keys) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Cast the given keys to integers if they are numeric and string otherwise.
- protected int detachUsingCustomClass(mixed $ids) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Detach models from the relationship using a custom class.
- protected array extractAttachIdAndAttributes(mixed $key, mixed $value, array $attributes) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the attach record ID and extra attributes.
- protected array formatAttachRecord(int $key, mixed $value, array $attributes, bool $hasTimestamps) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create a full attachment record payload.
- protected array formatAttachRecords(array $ids, array $attributes) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Create an array of records to insert into the pivot table.
- protected array formatRecordsList(array $records) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Format the sync / toggle record list so that it is keyed by ID.
- protected mixed forwardCallTo(mixed $object, string $method, array $parameters) - defined in Illuminate\Database\Eloquent\Relations\Relation. Forward a method call to the given object.
- protected Illuminate\Support\Collection getCurrentlyAttachedPivots() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the pivot models that are currently attached.
- protected array getKeys(array $models, string $key=NULL) - defined in Illuminate\Database\Eloquent\Relations\Relation. Get all of the primary keys for an array of models.
- protected mixed getTypeSwapValue(string $type, mixed $value) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Converts a given value to a given type value.
- protected string guessInverseRelation() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Attempt to guess the name of the inverse of the relation.
- protected void hydratePivotRelation(array $models) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Hydrate the pivot table relationship on the models.
- protected array migratePivotAttributes(Illuminate\Database\Eloquent\Model $model) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the pivot attributes from a model.
- protected mixed parseId(mixed $value) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get the ID from the given mixed value.
- protected array parseIds(mixed $value) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Get all of the IDs from the given mixed value.
- protected $this performJoin(Illuminate\Database\Eloquent\Builder|null $query=NULL) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Set the join clause for the relation query.
- protected string resolveTableName(string $table) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Attempt to resolve the intermediate table name from the given string.
- protected static void throwBadMethodCallException(string $method) - defined in Illuminate\Database\Eloquent\Relations\Relation. Throw a bad method call exception for the given method.
- protected bool touchingParent() - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Determine if we should touch the parent on sync.
- protected int updateExistingPivotUsingCustomClass(mixed $id, array $attributes, bool $touch) - defined in Illuminate\Database\Eloquent\Relations\BelongsToMany. Update an existing pivot record on the table via a custom class.
- protected string whereInMethod(Illuminate\Database\Eloquent\Model $model, string $key) - defined in Illuminate\Database\Eloquent\Relations\Relation. Get the name of the "where in" method for eager loading.