@@ -164,7 +164,7 @@ |
||
| 164 | 164 | |
| 165 | 165 | // @TODO: this should probably be checked outside of this method because we won't always have Auth::user() |
| 166 | 166 | if(!is_null(Auth::user()) && Auth::user()->id === $id) { |
| 167 | - throw new DisplayException('Cannot delete your own account.'); |
|
| 167 | + throw new DisplayException('Cannot delete your own account.'); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | DB::beginTransaction(); |
@@ -66,11 +66,11 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | - * Create Server |
|
| 70 | - * |
|
| 71 | - * @Post("/servers") |
|
| 72 | - * @Versions({"v1"}) |
|
| 73 | - * @Response(201) |
|
| 69 | + * Create Server |
|
| 70 | + * |
|
| 71 | + * @Post("/servers") |
|
| 72 | + * @Versions({"v1"}) |
|
| 73 | + * @Response(201) |
|
| 74 | 74 | */ |
| 75 | 75 | public function create(Request $request) |
| 76 | 76 | { |
@@ -220,14 +220,14 @@ discard block |
||
| 220 | 220 | * @Versions({"v1"}) |
| 221 | 221 | * @Response(200) |
| 222 | 222 | */ |
| 223 | - public function allocations(Request $request) |
|
| 224 | - { |
|
| 225 | - $allocations = Models\Allocation::all(); |
|
| 226 | - if ($allocations->count() < 1) { |
|
| 227 | - throw new NotFoundHttpException('No allocations have been created.'); |
|
| 228 | - } |
|
| 229 | - return $allocations; |
|
| 230 | - } |
|
| 223 | + public function allocations(Request $request) |
|
| 224 | + { |
|
| 225 | + $allocations = Models\Allocation::all(); |
|
| 226 | + if ($allocations->count() < 1) { |
|
| 227 | + throw new NotFoundHttpException('No allocations have been created.'); |
|
| 228 | + } |
|
| 229 | + return $allocations; |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | 233 | * List Node Allocation based on assigned to ID |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | * @Versions({"v1"}) |
| 239 | 239 | * @Response(200) |
| 240 | 240 | */ |
| 241 | - public function allocationsView(Request $request, $id) |
|
| 242 | - { |
|
| 241 | + public function allocationsView(Request $request, $id) |
|
| 242 | + { |
|
| 243 | 243 | $query = Models\Allocation::where('assigned_to', $id)->get(); |
| 244 | 244 | try { |
| 245 | 245 | |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $casts = [ |
|
| 51 | - 'user_id' => 'integer', |
|
| 52 | - 'server_id' => 'integer', |
|
| 53 | - ]; |
|
| 50 | + protected $casts = [ |
|
| 51 | + 'user_id' => 'integer', |
|
| 52 | + 'server_id' => 'integer', |
|
| 53 | + ]; |
|
| 54 | 54 | |
| 55 | 55 | public function scopePermission($query, $permission) |
| 56 | 56 | { |
@@ -54,10 +54,10 @@ |
||
| 54 | 54 | * |
| 55 | 55 | * @var array |
| 56 | 56 | */ |
| 57 | - protected $casts = [ |
|
| 58 | - 'id' => 'integer', |
|
| 59 | - 'server_id' => 'integer', |
|
| 60 | - 'db_server' => 'integer' |
|
| 61 | - ]; |
|
| 57 | + protected $casts = [ |
|
| 58 | + 'id' => 'integer', |
|
| 59 | + 'server_id' => 'integer', |
|
| 60 | + 'db_server' => 'integer' |
|
| 61 | + ]; |
|
| 62 | 62 | |
| 63 | 63 | } |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @var array |
| 66 | 66 | */ |
| 67 | - protected $casts = [ |
|
| 68 | - 'root_admin' => 'integer', |
|
| 69 | - 'use_totp' => 'integer', |
|
| 70 | - ]; |
|
| 67 | + protected $casts = [ |
|
| 68 | + 'root_admin' => 'integer', |
|
| 69 | + 'use_totp' => 'integer', |
|
| 70 | + ]; |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * The attributes excluded from the model's JSON form. |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | protected $hidden = ['password', 'remember_token', 'totp_secret']; |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * The rules for user passwords |
|
| 81 | - * |
|
| 82 | - * @var string |
|
| 83 | - */ |
|
| 80 | + * The rules for user passwords |
|
| 81 | + * |
|
| 82 | + * @var string |
|
| 83 | + */ |
|
| 84 | 84 | const PASSWORD_RULES = 'min:8|regex:((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,})'; |
| 85 | 85 | |
| 86 | 86 | public function permissions() |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $casts = [ |
|
| 51 | - 'node' => 'integer', |
|
| 52 | - 'port' => 'integer', |
|
| 53 | - 'assigned_to' => 'integer', |
|
| 54 | - ]; |
|
| 50 | + protected $casts = [ |
|
| 51 | + 'node' => 'integer', |
|
| 52 | + 'port' => 'integer', |
|
| 53 | + 'assigned_to' => 'integer', |
|
| 54 | + ]; |
|
| 55 | 55 | |
| 56 | 56 | } |
@@ -47,9 +47,9 @@ |
||
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $casts = [ |
|
| 51 | - 'server_id' => 'integer', |
|
| 52 | - 'variable_id' => 'integer', |
|
| 53 | - ]; |
|
| 50 | + protected $casts = [ |
|
| 51 | + 'server_id' => 'integer', |
|
| 52 | + 'variable_id' => 'integer', |
|
| 53 | + ]; |
|
| 54 | 54 | |
| 55 | 55 | } |
@@ -47,17 +47,17 @@ |
||
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $casts = [ |
|
| 51 | - 'id' => 'integer', |
|
| 52 | - 'task_id' => 'integer', |
|
| 53 | - 'run_status' => 'integer' |
|
| 54 | - ]; |
|
| 50 | + protected $casts = [ |
|
| 51 | + 'id' => 'integer', |
|
| 52 | + 'task_id' => 'integer', |
|
| 53 | + 'run_status' => 'integer' |
|
| 54 | + ]; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * The attributes that should be mutated to dates. |
|
| 58 | - * |
|
| 59 | - * @var array |
|
| 60 | - */ |
|
| 56 | + /** |
|
| 57 | + * The attributes that should be mutated to dates. |
|
| 58 | + * |
|
| 59 | + * @var array |
|
| 60 | + */ |
|
| 61 | 61 | protected $dates = ['run_time', 'created_at', 'updated_at']; |
| 62 | 62 | |
| 63 | 63 | } |