BelongsToMany::firstOrCreate()

Model firstOrCreate(array $attributes, array $joining = array(), bool $touch = true) Get the first related record matching the attributes or create it. Parameters array $attributes array $joining bool $touch Return Value Model

BelongsToMany::first()

mixed first(array $columns = array('*')) Execute the query and get the first result. Parameters array $columns Return Value mixed

BelongsToMany::findOrNew()

Collection|Model findOrNew(mixed $id, array $columns = array('*')) Find a related model by its primary key or return new instance of the related model. Parameters mixed $id array $columns Return Value Collection|Model

BelongsToMany::findOrFail()

Model|Collection findOrFail(mixed $id, array $columns = array('*')) Find a related model by its primary key or throw an exception. Parameters mixed $id array $columns Return Value Model|Collection Exceptions ModelNotFoundException

BelongsToMany::findMany()

Collection findMany(mixed $ids, array $columns = array('*')) Find multiple related models by their primary keys. Parameters mixed $ids array $columns Return Value Collection

BelongsToMany::find()

Model|Collection|null find(mixed $id, array $columns = array('*')) Find a related model by its primary key. Parameters mixed $id array $columns Return Value Model|Collection|null

BelongsToMany::detach()

int detach(mixed $ids = array(), bool $touch = true) Detach models from the relationship. Parameters mixed $ids bool $touch Return Value int

BelongsToMany::createMany()

array createMany(array $records, array $joinings = array()) Create an array of new instances of the related models. Parameters array $records array $joinings Return Value array

BelongsToMany::createdAt()

string createdAt() Get the name of the "created at" column. Return Value string

BelongsToMany::create()

Model create(array $attributes, array $joining = array(), bool $touch = true) Create a new instance of the related model. Parameters array $attributes array $joining bool $touch Return Value Model