You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,12 @@ protected $fillable = array(
15
15
}
16
16
```
17
17
18
-
and must have this method :
18
+
and must use the following trait:
19
19
20
20
```php
21
-
public function newCollection(array $models = array())
22
-
{
23
-
return new \TypiCMS\NestableCollection($models);
24
-
}
21
+
22
+
use TypiCMS\NestableTrait;
23
+
25
24
```
26
25
27
26
Now each time you get a collection of that model, it will be an instance of **TypiCMS\NestableCollection** in place of **Illuminate\Database\Eloquent\Collection**.
0 commit comments