Skip to content

Commit f1cf43f

Browse files
committed
wip
1 parent 58d7d2f commit f1cf43f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/docs/3.0/repository-pattern/repository-pattern.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,23 @@ public function resolveShowMeta($request)
341341
}
342342
```
343343

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+
344361
## Custom routes
345362

346363
Laravel Restify has its own "CRUD" routes, however you're able to define your own routes right from your Repository class:

0 commit comments

Comments
 (0)