From 8d22ae104bbd07b64efb0ae8af13936309dd3a1a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 21 Apr 2022 17:13:48 -0500 Subject: [PATCH] update description of custom pivot model capabilities custom pivot models can do more than just define methods, such as cast attributes. we'll also make the wording a little more open ended so the reader doesn't think the capabilities are limited. --- eloquent-relationships.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent-relationships.md b/eloquent-relationships.md index a31aa6af7a3..a1053bd74e1 100644 --- a/eloquent-relationships.md +++ b/eloquent-relationships.md @@ -663,7 +663,7 @@ You can also filter the results returned by `belongsToMany` relationship queries ### Defining Custom Intermediate Table Models -If you would like to define a custom model to represent the intermediate table of your many-to-many relationship, you may call the `using` method when defining the relationship. Custom pivot models give you the opportunity to define additional methods on the pivot model. +If you would like to define a custom model to represent the intermediate table of your many-to-many relationship, you may call the `using` method when defining the relationship. Custom pivot models give you the opportunity to define additional behavior on the pivot model, such as methods and casts. Custom many-to-many pivot models should extend the `Illuminate\Database\Eloquent\Relations\Pivot` class while custom polymorphic many-to-many pivot models should extend the `Illuminate\Database\Eloquent\Relations\MorphPivot` class. For example, we may define a `Role` model which uses a custom `RoleUser` pivot model: