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: docs/docs/3.0/repository-pattern/repository-pattern.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -341,6 +341,23 @@ public function resolveShowMeta($request)
341
341
}
342
342
```
343
343
344
+
345
+
## Merge all model attributes
346
+
347
+
Laravel Restify will show and fill only attributes defined in the `fields` method of the repository. However, you can merge all of the model attributes by implementing `Mergeable` contract:
348
+
349
+
```php
350
+
351
+
use Binaryk\LaravelRestify\Repositories\Mergeable;
352
+
353
+
class PostRepository extends Repository implements Mergeable
354
+
{
355
+
//
356
+
}
357
+
```
358
+
359
+
Even if you didn't specify any field in your `fields` method, the show/index requests will always return all the model attributes in this case.
360
+
344
361
## Custom routes
345
362
346
363
Laravel Restify has its own "CRUD" routes, however you're able to define your own routes right from your Repository class:
0 commit comments