Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function index() |
||
18 | { |
||
19 | $model = config('webfactor.documents.model_class'); |
||
20 | |||
21 | $documents = $model::all(); |
||
22 | |||
23 | if (!$documents || !$documents->count()) { |
||
24 | return $this->respondNoEntries(); |
||
25 | } |
||
26 | |||
27 | return $this->setResponsePayload([ |
||
28 | 'documents' => fractal($documents, new DocumentTransformer(), new ArraySerializer()) |
||
29 | ])->respondWithSuccess(); |
||
30 | } |
||
31 | } |
||
32 |