@@ -59,7 +59,8 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | protected function unauthenticated($request, AuthenticationException $exception) |
| 61 | 61 | { |
| 62 | - if ($request->expectsJson()) { |
|
| 62 | + if ($request->expectsJson()) |
|
| 63 | + { |
|
| 63 | 64 | return response()->json(['error' => 'Unauthenticated.'], 401); |
| 64 | 65 | } |
| 65 | 66 | |
@@ -54,7 +54,8 @@ discard block |
||
| 54 | 54 | Route::group([ |
| 55 | 55 | 'middleware' => 'web', |
| 56 | 56 | 'namespace' => $this->namespace, |
| 57 | - ], function ($router) { |
|
| 57 | + ], function ($router) |
|
| 58 | + { |
|
| 58 | 59 | require base_path('routes/web.php'); |
| 59 | 60 | }); |
| 60 | 61 | } |
@@ -72,7 +73,8 @@ discard block |
||
| 72 | 73 | 'middleware' => 'api', |
| 73 | 74 | 'namespace' => $this->namespace, |
| 74 | 75 | 'prefix' => 'api', |
| 75 | - ], function ($router) { |
|
| 76 | + ], function ($router) |
|
| 77 | + { |
|
| 76 | 78 | require base_path('routes/api.php'); |
| 77 | 79 | }); |
| 78 | 80 | } |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | /* |
| 21 | 21 | * Authenticate the user's personal channel... |
| 22 | 22 | */ |
| 23 | - Broadcast::channel('App.User.*', function (User $user, $userId) { |
|
| 23 | + Broadcast::channel('App.User.*', function (User $user, $userId) |
|
| 24 | + { |
|
| 24 | 25 | return (int) $user->id === (int) $userId; |
| 25 | 26 | }); |
| 26 | 27 | } |
@@ -40,14 +40,18 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function showAddEditForm($id = null) |
| 42 | 42 | { |
| 43 | - if ($id === null) { |
|
| 43 | + if ($id === null) |
|
| 44 | + { |
|
| 44 | 45 | $dataset = new Room(); |
| 45 | 46 | $title = trans('general.add'); |
| 46 | 47 | $submit_route = route($this->getRouteName().'.postadd'); |
| 47 | - } else { |
|
| 48 | - try { |
|
| 48 | + } else |
|
| 49 | + { |
|
| 50 | + try |
|
| 51 | + { |
|
| 49 | 52 | $dataset = Room::findOrFail($id); |
| 50 | - } catch (ModelNotFoundException $e) { |
|
| 53 | + } catch (ModelNotFoundException $e) |
|
| 54 | + { |
|
| 51 | 55 | return Controller::returnBack([ |
| 52 | 56 | 'message' => trans('general.object_not_found'), |
| 53 | 57 | 'alert-class' => 'alert-danger', |
@@ -77,7 +81,8 @@ discard block |
||
| 77 | 81 | [ |
| 78 | 82 | 'id' => 'number', |
| 79 | 83 | 'title' => trans('general.number'), |
| 80 | - 'value' => function (Room $data) { |
|
| 84 | + 'value' => function (Room $data) |
|
| 85 | + { |
|
| 81 | 86 | return $data->number; |
| 82 | 87 | }, |
| 83 | 88 | 'type' => 'number', |
@@ -88,7 +93,8 @@ discard block |
||
| 88 | 93 | [ |
| 89 | 94 | 'id' => 'floor', |
| 90 | 95 | 'title' => trans('general.floor'), |
| 91 | - 'value' => function (Room $data) { |
|
| 96 | + 'value' => function (Room $data) |
|
| 97 | + { |
|
| 92 | 98 | return $data->floor; |
| 93 | 99 | }, |
| 94 | 100 | 'type' => 'number', |
@@ -99,7 +105,8 @@ discard block |
||
| 99 | 105 | [ |
| 100 | 106 | 'id' => 'capacity', |
| 101 | 107 | 'title' => trans('general.capacity'), |
| 102 | - 'value' => function (Room $data) { |
|
| 108 | + 'value' => function (Room $data) |
|
| 109 | + { |
|
| 103 | 110 | return $data->capacity; |
| 104 | 111 | }, |
| 105 | 112 | 'type' => 'number', |
@@ -110,7 +117,8 @@ discard block |
||
| 110 | 117 | [ |
| 111 | 118 | 'id' => 'price', |
| 112 | 119 | 'title' => trans('general.price'), |
| 113 | - 'value' => function (Room $data) { |
|
| 120 | + 'value' => function (Room $data) |
|
| 121 | + { |
|
| 114 | 122 | return $data->price; |
| 115 | 123 | }, |
| 116 | 124 | 'type' => 'number', |
@@ -123,7 +131,8 @@ discard block |
||
| 123 | 131 | [ |
| 124 | 132 | 'id' => 'comments', |
| 125 | 133 | 'title' => trans('general.comment'), |
| 126 | - 'value' => function (Room $data) { |
|
| 134 | + 'value' => function (Room $data) |
|
| 135 | + { |
|
| 127 | 136 | return $data->comments; |
| 128 | 137 | }, |
| 129 | 138 | 'type' => 'textarea', |
@@ -136,25 +145,29 @@ discard block |
||
| 136 | 145 | $dataset = [ |
| 137 | 146 | [ |
| 138 | 147 | 'title' => trans('general.number'), |
| 139 | - 'value' => function (Room $data) { |
|
| 148 | + 'value' => function (Room $data) |
|
| 149 | + { |
|
| 140 | 150 | return $data->number; |
| 141 | 151 | }, |
| 142 | 152 | ], |
| 143 | 153 | [ |
| 144 | 154 | 'title' => trans('general.floor'), |
| 145 | - 'value' => function (Room $data) { |
|
| 155 | + 'value' => function (Room $data) |
|
| 156 | + { |
|
| 146 | 157 | return $data->floor; |
| 147 | 158 | }, |
| 148 | 159 | ], |
| 149 | 160 | [ |
| 150 | 161 | 'title' => trans('general.capacity'), |
| 151 | - 'value' => function (Room $data) { |
|
| 162 | + 'value' => function (Room $data) |
|
| 163 | + { |
|
| 152 | 164 | return $data->capacity; |
| 153 | 165 | }, |
| 154 | 166 | ], |
| 155 | 167 | [ |
| 156 | 168 | 'title' => trans('general.price'), |
| 157 | - 'value' => function (Room $data) { |
|
| 169 | + 'value' => function (Room $data) |
|
| 170 | + { |
|
| 158 | 171 | return $data->price; |
| 159 | 172 | }, |
| 160 | 173 | ], |
@@ -19,7 +19,8 @@ |
||
| 19 | 19 | protected function returnBack($data) |
| 20 | 20 | { |
| 21 | 21 | // Zapobiegaj infinite loop |
| 22 | - if (back()->getTargetUrl() === url()->current()) { |
|
| 22 | + if (back()->getTargetUrl() === url()->current()) |
|
| 23 | + { |
|
| 23 | 24 | return redirect(route('room.index'))->with($data); |
| 24 | 25 | } |
| 25 | 26 | |
@@ -21,9 +21,11 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function handle(Request $request, Closure $next) |
| 23 | 23 | { |
| 24 | - if (Cookie::get('lang') !== null) { |
|
| 24 | + if (Cookie::get('lang') !== null) |
|
| 25 | + { |
|
| 25 | 26 | $locale = Crypt::decrypt($request->cookie('lang')); |
| 26 | - } else { |
|
| 27 | + } else |
|
| 28 | + { |
|
| 27 | 29 | $locale = Config::get('app.locale'); |
| 28 | 30 | } |
| 29 | 31 | |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function handle($request, Closure $next, $guard = null) |
| 20 | 20 | { |
| 21 | - if (Auth::guard($guard)->check()) { |
|
| 21 | + if (Auth::guard($guard)->check()) |
|
| 22 | + { |
|
| 22 | 23 | return redirect('/home'); |
| 23 | 24 | } |
| 24 | 25 | |