| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function handleHistory(Request $request, $id) |
||
| 24 | { |
||
| 25 | $this->beforeInit(); |
||
| 26 | $this->init(); |
||
| 27 | $this->bound(); |
||
| 28 | |||
| 29 | if (!$this->can('history')) { |
||
| 30 | throw UnauthorizedException::forPermissions(['history']); |
||
| 31 | } |
||
| 32 | |||
| 33 | $model = $this->crud()->repo()->find($id); |
||
| 34 | if (!$this->crud()->actions()->isAllowed('history', $model)) { |
||
| 35 | throw new PermissionDenied(); |
||
| 36 | } |
||
| 37 | |||
| 38 | return view($this->historyCrudHistory, [ |
||
| 39 | 'crud' => $this->crud(), |
||
| 40 | 'item' => $model, |
||
| 41 | 'versions' => $model->versions()->latest()->paginate(8), |
||
| 42 | ]); |
||
| 43 | } |
||
| 44 | |||
| 51 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@returndoc comment to communicate to implementors of these methods what they are expected to return.