@@ -185,7 +185,7 @@ |
||
| 185 | 185 | * Or when the user is not a global admin. |
| 186 | 186 | * |
| 187 | 187 | * @param string $key The path to check |
| 188 | - * @return bool|string false or the source: config | auth |
|
| 188 | + * @return string|false false or the source: config | auth |
|
| 189 | 189 | */ |
| 190 | 190 | public function isReadOnly($key) |
| 191 | 191 | { |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | */ |
| 190 | 190 | public function isReadOnly($key) |
| 191 | 191 | { |
| 192 | - if(Config::has('config.'.$key)) { |
|
| 192 | + if (Config::has('config.'.$key)) { |
|
| 193 | 193 | return 'config'; |
| 194 | 194 | } |
| 195 | 195 | $user = \Auth::user(); |
@@ -195,7 +195,8 @@ |
||
| 195 | 195 | $user = \Auth::user(); |
| 196 | 196 | if (!is_null($user) && $user->isAdmin()) { |
| 197 | 197 | return false; |
| 198 | - } else { |
|
| 198 | + } |
|
| 199 | + else { |
|
| 199 | 200 | return 'auth'; |
| 200 | 201 | } |
| 201 | 202 | } |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | namespace App\Http\Controllers\Alerting; |
| 27 | 27 | |
| 28 | -use Illuminate\Http\Request; |
|
| 29 | 28 | use App\DataTables\AlertsDataTable; |
| 30 | 29 | use App\Http\Controllers\Controller; |
| 30 | +use Illuminate\Http\Request; |
|
| 31 | 31 | |
| 32 | 32 | class AlertsController extends Controller |
| 33 | 33 | { |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * Turn this item object into a generic array |
| 35 | 35 | * |
| 36 | - * @param Notification $logs |
|
| 36 | + * @param Log $logs |
|
| 37 | 37 | * @return array |
| 38 | 38 | */ |
| 39 | 39 | public function transform(Log $logs) |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | |
| 26 | 26 | namespace App\DataTables\Alerting; |
| 27 | 27 | |
| 28 | -use App\Models\Alerting\Alert; |
|
| 29 | 28 | use App\Models\Alerting\Log; |
| 30 | 29 | use Yajra\Datatables\Services\DataTable; |
| 31 | 30 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function query() |
| 91 | 91 | { |
| 92 | - $logs = Log::query()->with('device','user','rule')->select('alert_log.*'); |
|
| 92 | + $logs = Log::query()->with('device', 'user', 'rule')->select('alert_log.*'); |
|
| 93 | 93 | return $this->applyScopes($logs); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -102,7 +102,8 @@ |
||
| 102 | 102 | } catch(\Exception $e) { |
| 103 | 103 | if(starts_with($e->getMessage(), 'unserialize():')) { |
| 104 | 104 | return $value; |
| 105 | - } else { |
|
| 105 | + } |
|
| 106 | + else { |
|
| 106 | 107 | throw $e; |
| 107 | 108 | } |
| 108 | 109 | } |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | namespace App\Http\Controllers\Alerting; |
| 27 | 27 | |
| 28 | -use Illuminate\Http\Request; |
|
| 29 | 28 | use App\DataTables\AlertsDataTable; |
| 30 | 29 | use App\Http\Controllers\Controller; |
| 30 | +use Illuminate\Http\Request; |
|
| 31 | 31 | |
| 32 | 32 | class AlertsController extends Controller |
| 33 | 33 | { |