@@ -2,12 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Api\Controllers; |
| 4 | 4 | |
| 5 | -use Validator; |
|
| 6 | -use App\Models\User; |
|
| 7 | 5 | use App\Models\Dashboard; |
| 8 | 6 | use App\Models\UsersWidgets; |
| 9 | 7 | use Dingo\Api\Routing\Helpers; |
| 10 | 8 | use Illuminate\Http\Request; |
| 9 | +use Validator; |
|
| 11 | 10 | |
| 12 | 11 | class DashboardController extends Controller |
| 13 | 12 | { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'name' => 'required|max:255', |
| 52 | 52 | 'access' => 'required', |
| 53 | 53 | ]); |
| 54 | - if($validation->passes()) |
|
| 54 | + if ($validation->passes()) |
|
| 55 | 55 | { |
| 56 | 56 | $dashboard = new dashboard; |
| 57 | 57 | $dashboard->dashboard_name = $request->name; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | else { |
| 80 | 80 | $errors = $validation->errors(); |
| 81 | - return response()->json($errors,422); |
|
| 81 | + return response()->json($errors, 422); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | 'name' => 'required|max:255', |
| 124 | 124 | 'access' => 'required', |
| 125 | 125 | ]); |
| 126 | - if($validation->passes()) |
|
| 126 | + if ($validation->passes()) |
|
| 127 | 127 | { |
| 128 | 128 | $dashboard = Dashboard::find($id); |
| 129 | 129 | $dashboard->dashboard_name = $request->name; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | else { |
| 140 | 140 | $errors = $validation->errors(); |
| 141 | - return response()->json($errors,422); |
|
| 141 | + return response()->json($errors, 422); |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Api\Controllers; |
| 4 | 4 | |
| 5 | -use App\Models\Widgets; |
|
| 6 | 5 | use App\Models\Dashboard; |
| 7 | 6 | use App\Models\UsersWidgets; |
| 7 | +use App\Models\Widgets; |
|
| 8 | 8 | use Dingo\Api\Http; |
| 9 | 9 | use Dingo\Api\Routing\Helpers; |
| 10 | 10 | use Illuminate\Http\Request; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function store(Request $request) |
| 48 | 48 | { |
| 49 | - $row = Dashboard::find($request->dashboard_id)->widgets()->max('row')+1; |
|
| 49 | + $row = Dashboard::find($request->dashboard_id)->widgets()->max('row') + 1; |
|
| 50 | 50 | $user_widget = new UsersWidgets; |
| 51 | 51 | $user_widget->user_id = $request->user()->user_id; |
| 52 | 52 | $user_widget->widget_id = $request->widget_id; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | public function show(Request $request, $id) |
| 75 | 75 | { |
| 76 | 76 | $widget = Widgets::find($id); |
| 77 | - $content = $this->api->be(auth()->user())->get('/api/dashboard-widget/' . $id . '/content'); |
|
| 77 | + $content = $this->api->be(auth()->user())->get('/api/dashboard-widget/'.$id.'/content'); |
|
| 78 | 78 | return array('widget' => $widget, 'content' => $content); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -2,12 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | +use App\Models\Dashboard; |
|
| 5 | 6 | use Dingo\Api\Http; |
| 6 | 7 | use Dingo\Api\Routing\Helpers; |
| 7 | 8 | use Illuminate\Http\Request; |
| 8 | -use App\Models\Dashboard; |
|
| 9 | 9 | use JWTAuth; |
| 10 | -use Tymon\JWTAuth\Exceptions\JWTException; |
|
| 11 | 10 | |
| 12 | 11 | class HomeController extends Controller |
| 13 | 12 | { |