@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $this->regency = $regency; |
34 | 34 | $this->province = $province; |
35 | - $this->dashboard_apel = $dashboard_apel; |
|
35 | + $this->dashboard_apel = $dashboard_apel; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function index(Request $request) |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function store(Request $request) |
70 | 70 | { |
71 | 71 | |
72 | - $validator = Validator::make($request->all(),[ |
|
72 | + $validator = Validator::make($request->all(), [ |
|
73 | 73 | 'negara' => 'required', |
74 | 74 | 'province_id' => 'required', |
75 | 75 | 'regency_id' => 'required', |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | 'data' => 'required|integer', |
79 | 79 | ]); |
80 | 80 | |
81 | - if($validator->fails()) |
|
81 | + if ($validator->fails()) |
|
82 | 82 | { |
83 | 83 | return response()->json([ |
84 | 84 | 'title' => 'error', |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | ]); |
89 | 89 | } |
90 | 90 | |
91 | - $check = $this->dashboard_apel->where('regency_id',$request->regency_id)->where('tahun',$request->tahun)->count(); |
|
91 | + $check = $this->dashboard_apel->where('regency_id', $request->regency_id)->where('tahun', $request->tahun)->count(); |
|
92 | 92 | |
93 | - if($check > 0) |
|
93 | + if ($check > 0) |
|
94 | 94 | { |
95 | 95 | return response()->json([ |
96 | 96 | 'title' => 'error', |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | 'type' => 'failed', |
99 | 99 | ]); |
100 | 100 | |
101 | - }else{ |
|
101 | + }else { |
|
102 | 102 | $data = $this->dashboard_apel->create($request->all()); |
103 | 103 | |
104 | 104 | return response()->json([ |
105 | 105 | 'type' => 'success', |
106 | 106 | 'title' => 'success', |
107 | 107 | 'id' => $data->id, |
108 | - 'message' => 'PDRB '. $this->regency->find($request->regency_id)->name .' tahun '. $request->tahun .' successfully created', |
|
108 | + 'message' => 'PDRB '.$this->regency->find($request->regency_id)->name.' tahun '.$request->tahun.' successfully created', |
|
109 | 109 | ]); |
110 | 110 | } |
111 | 111 |
@@ -98,7 +98,7 @@ |
||
98 | 98 | 'type' => 'failed', |
99 | 99 | ]); |
100 | 100 | |
101 | - }else{ |
|
101 | + } else{ |
|
102 | 102 | $data = $this->dashboard_apel->create($request->all()); |
103 | 103 | |
104 | 104 | return response()->json([ |