Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function destroy($id) |
||
35 | { |
||
36 | if ($this->resource->form()->destroy($id)) { |
||
37 | $data = [ |
||
38 | 'status' => true, |
||
39 | 'message' => trans('admin.delete_succeeded'), |
||
40 | ]; |
||
41 | } else { |
||
42 | $data = [ |
||
43 | 'status' => false, |
||
44 | 'message' => trans('admin.delete_failed'), |
||
45 | ]; |
||
46 | } |
||
47 | |||
48 | return response()->json($data); |
||
49 | } |
||
50 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: