Update eloquent-relationships.md

This commit is contained in:
Daniel Lovatt 2018-08-14 11:13:24 +01:00 committed by GitHub
parent 92f0b2f34e
commit 3a775c2d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -325,7 +325,7 @@ You can also filter the results returned by `belongsToMany` using the `wherePivo
#### Defining Custom Intermediate Table Models
If you would like to define a custom model to represent the intermediate table of your relationship, you may call the `using` method when defining the relationship. All custom models used to represent intermediate tables of relationships must extend the `Illuminate\Database\Eloquent\Relations\Pivot` class. For example, we may define a `Role` which uses a custom `UserRole` pivot model:
If you would like to define a custom model to represent the intermediate table of your relationship, you may call the `using` method when defining the relationship. Many to Many relationships should extend `Illuminate\Database\Eloquent\Relations\Pivot` and Many To Many Polymorphic relationships the `Illuminate\Database\Eloquent\Relations\MorphPivot` class. For example, we may define a `Role` which uses a custom `UserRole` pivot model:
<?php