@@ -5,19 +5,19 @@ |
||
| 5 | 5 | class SettingsController extends Controller |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - /** |
|
| 9 | - * Store a newly created resource in storage. |
|
| 10 | - * |
|
| 11 | - * @return \Illuminate\Http\RedirectResponse |
|
| 12 | - */ |
|
| 13 | - public function update() |
|
| 14 | - { |
|
| 8 | + /** |
|
| 9 | + * Store a newly created resource in storage. |
|
| 10 | + * |
|
| 11 | + * @return \Illuminate\Http\RedirectResponse |
|
| 12 | + */ |
|
| 13 | + public function update() |
|
| 14 | + { |
|
| 15 | 15 | $input = \Input::only('key', 'value'); |
| 16 | 16 | |
| 17 | 17 | Settings::change($input['key'], $input['value']); |
| 18 | 18 | |
| 19 | 19 | \Notification::success("Setting updated"); |
| 20 | 20 | return redirect()->back()->withInput(); |
| 21 | - } |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | 23 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function handle($request, Closure $next) |
| 15 | 15 | { |
| 16 | - if( ! $request->isSecure() && env('FORCE_SECURE', 'true')) { |
|
| 16 | + if ( ! $request->isSecure() && env('FORCE_SECURE', 'true')) { |
|
| 17 | 17 | if ((strpos($request->path(), 'access-control/') !== 0) && ($request->path() !== 'acs') && ($request->path() !== 'acs/spark')) { |
| 18 | 18 | return redirect()->secure($request->path()); |
| 19 | 19 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | Route::post('account/{account}/payment', ['uses' => 'PaymentController@store', 'as' => 'account.payment.store', 'middleware' => 'role:admin']); |
| 74 | 74 | |
| 75 | -Route::group(array('middleware' => 'role:finance'), function() { |
|
| 75 | +Route::group(array('middleware' => 'role:finance'), function () { |
|
| 76 | 76 | Route::resource('payments', 'PaymentController', ['only' => ['index', 'destroy', 'update']]); |
| 77 | 77 | Route::get('payments/overview', ['uses'=>'PaymentOverviewController@index', 'as'=>'payments.overview']); |
| 78 | 78 | Route::get('payments/sub-charges', ['as' => 'payments.sub-charges', 'uses' => 'SubscriptionController@listCharges']); |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | //Cash |
| 95 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
| 95 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
| 96 | 96 | Route::post('account/{account}/payment/cash/create', ['as'=>'account.payment.cash.create', 'uses' => 'CashPaymentController@store']); |
| 97 | 97 | Route::delete('account/{account}/payment/cash', ['as'=>'account.payment.cash.destroy', 'uses' => 'CashPaymentController@destroy']); |
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | 100 | # Statements |
| 101 | -Route::group(array('middleware' => 'role:finance'), function() { |
|
| 101 | +Route::group(array('middleware' => 'role:finance'), function () { |
|
| 102 | 102 | Route::resource('statement-import', 'StatementImportController', ['except' => ['index', 'show', 'edit', 'update', 'destroy']]); |
| 103 | 103 | }); |
| 104 | 104 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | # Inductions |
| 112 | 112 | ########################## |
| 113 | 113 | |
| 114 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
| 114 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
| 115 | 115 | Route::post('equipment_training/update', ['uses'=>'InductionController@update', 'as'=>'equipment_training.update']); |
| 116 | 116 | Route::resource('account.induction', 'InductionController', ['only' => ['update', 'destroy']]); |
| 117 | 117 | }); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | # Equipment |
| 123 | 123 | ########################## |
| 124 | 124 | |
| 125 | -Route::group(array('middleware' => 'role:member'), function() { |
|
| 125 | +Route::group(array('middleware' => 'role:member'), function () { |
|
| 126 | 126 | Route::resource('equipment', 'EquipmentController'); |
| 127 | 127 | Route::post('equipment/{id}/photo', ['uses'=>'EquipmentController@addPhoto', 'as'=>'equipment.photo.store']); |
| 128 | 128 | Route::delete('equipment/{id}/photo/{key}', ['uses'=>'EquipmentController@destroyPhoto', 'as'=>'equipment.photo.destroy']); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | # Key fobs |
| 146 | 146 | ########################## |
| 147 | 147 | |
| 148 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
| 148 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
| 149 | 149 | Route::resource('keyfob', 'KeyFobController', ['only' => ['index', 'store', 'update', 'destroy']]); |
| 150 | 150 | }); |
| 151 | 151 | |
@@ -178,11 +178,11 @@ discard block |
||
| 178 | 178 | Route::post('camera/event/store', ['uses' => 'CCTVController@store']); |
| 179 | 179 | Route::post('camera/store', ['uses' => 'CCTVController@storeSingle']); |
| 180 | 180 | |
| 181 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
| 181 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
| 182 | 182 | Route::resource('detected_devices', 'DetectedDevicesController'); |
| 183 | 183 | }); |
| 184 | 184 | |
| 185 | -Route::group(array('middleware' => 'role:acs'), function() { |
|
| 185 | +Route::group(array('middleware' => 'role:acs'), function () { |
|
| 186 | 186 | Route::resource('devices', 'DeviceController'); |
| 187 | 187 | }); |
| 188 | 188 | |
@@ -259,11 +259,11 @@ discard block |
||
| 259 | 259 | # Roles |
| 260 | 260 | ########################## |
| 261 | 261 | |
| 262 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
| 262 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
| 263 | 263 | Route::resource('roles', 'RolesController', []); |
| 264 | 264 | Route::resource('roles.users', 'RoleUsersController', ['only' => ['destroy', 'store']]); |
| 265 | 265 | }); |
| 266 | -Route::group(array('middleware' => 'role:member'), function() { |
|
| 266 | +Route::group(array('middleware' => 'role:member'), function () { |
|
| 267 | 267 | Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
| 268 | 268 | }); |
| 269 | 269 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | # Expenses |
| 283 | 283 | ########################## |
| 284 | 284 | |
| 285 | -Route::group(array('middleware' => 'role:member'), function() { |
|
| 285 | +Route::group(array('middleware' => 'role:member'), function () { |
|
| 286 | 286 | Route::resource('expenses', 'ExpensesController'); |
| 287 | 287 | }); |
| 288 | 288 | |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | |
| 308 | -Route::any('api-docs.json', function() { |
|
| 308 | +Route::any('api-docs.json', function () { |
|
| 309 | 309 | $filePath = Config::get('swagger.doc-dir') . "/api-docs.json"; |
| 310 | 310 | |
| 311 | - if (!File::Exists($filePath)) { |
|
| 311 | + if ( ! File::Exists($filePath)) { |
|
| 312 | 312 | App::abort(404, "Cannot find {$filePath}"); |
| 313 | 313 | } |
| 314 | 314 | |
@@ -318,13 +318,13 @@ discard block |
||
| 318 | 318 | )); |
| 319 | 319 | }); |
| 320 | 320 | |
| 321 | -Route::get('api-docs', function() { |
|
| 321 | +Route::get('api-docs', function () { |
|
| 322 | 322 | if (Config::get('swagger.generateAlways')) { |
| 323 | - $appDir = base_path()."/".Config::get('swagger.app-dir'); |
|
| 323 | + $appDir = base_path() . "/" . Config::get('swagger.app-dir'); |
|
| 324 | 324 | $docDir = Config::get('swagger.doc-dir'); |
| 325 | 325 | |
| 326 | 326 | |
| 327 | - if (!File::exists($docDir) || is_writable($docDir)) { |
|
| 327 | + if ( ! File::exists($docDir) || is_writable($docDir)) { |
|
| 328 | 328 | // delete all existing documentation |
| 329 | 329 | if (File::exists($docDir)) { |
| 330 | 330 | File::deleteDirectory($docDir); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | $excludeDirs = Config::get('swagger.excludes'); |
| 336 | 336 | |
| 337 | - $swagger = \Swagger\scan($appDir, [ |
|
| 337 | + $swagger = \Swagger\scan($appDir, [ |
|
| 338 | 338 | 'exclude' => $excludeDirs |
| 339 | 339 | ]); |
| 340 | 340 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $this->client = new \GoCardlessPro\Client([ |
| 28 | 28 | 'access_token' => env('NEW_GOCARDLESS_ACCESS_TOKEN'), |
| 29 | - 'environment' => (env('NEW_GOCARDLESS_ENV', 'LIVE') == 'LIVE')? \GoCardlessPro\Environment::LIVE: \GoCardlessPro\Environment::SANDBOX, |
|
| 29 | + 'environment' => (env('NEW_GOCARDLESS_ENV', 'LIVE') == 'LIVE') ? \GoCardlessPro\Environment::LIVE : \GoCardlessPro\Environment::SANDBOX, |
|
| 30 | 30 | ]); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | return $this->client->redirectFlows()->complete( |
| 53 | 53 | $user->gocardless_setup_id, |
| 54 | - ["params" => ["session_token" => 'user-token-'.$user->id]] |
|
| 54 | + ["params" => ["session_token" => 'user-token-' . $user->id]] |
|
| 55 | 55 | ); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -30,6 +30,9 @@ discard block |
||
| 30 | 30 | ]); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @return double |
|
| 35 | + */ |
|
| 33 | 36 | public function getPayment($paymentId) |
| 34 | 37 | { |
| 35 | 38 | return $this->client->payments()->get($paymentId); |
@@ -56,6 +59,11 @@ discard block |
||
| 56 | 59 | } |
| 57 | 60 | |
| 58 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string|null $mandate |
|
| 64 | + * @param integer $amount |
|
| 65 | + * @param string $subscriptionNumber |
|
| 66 | + */ |
|
| 59 | 67 | public function createSubscription($mandate, $amount, $dayOfMonth, $subscriptionNumber) |
| 60 | 68 | { |
| 61 | 69 | $subscription = $this->client->subscriptions()->create([ |
@@ -75,6 +83,10 @@ discard block |
||
| 75 | 83 | |
| 76 | 84 | return $subscription; |
| 77 | 85 | } |
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param string $id |
|
| 89 | + */ |
|
| 78 | 90 | public function cancelSubscription($id) |
| 79 | 91 | { |
| 80 | 92 | return $this->client->subscriptions()->cancel($id); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @param $message |
| 145 | 145 | * @param $device |
| 146 | - * @return Response |
|
| 146 | + * @return \Illuminate\Http\JsonResponse |
|
| 147 | 147 | */ |
| 148 | 148 | private function handleSystemCheckIn($message, $device, $service) |
| 149 | 149 | { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @param int $statusCode |
| 184 | 184 | * @param array $responseData |
| 185 | 185 | * |
| 186 | - * @return \Response |
|
| 186 | + * @return \Illuminate\Http\JsonResponse |
|
| 187 | 187 | */ |
| 188 | 188 | private function sendResponse($statusCode = 200, array $responseData) |
| 189 | 189 | { |
@@ -27,7 +27,8 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | private $equipmentLogRepository; |
| 29 | 29 | |
| 30 | - function __construct(ACSNodeRepository $acsNodeRepository, ACSValidator $ACSValidator, \BB\Services\KeyFobAccess $keyFobAccess, EquipmentLogRepository $equipmentLogRepository) { |
|
| 30 | + function __construct(ACSNodeRepository $acsNodeRepository, ACSValidator $ACSValidator, \BB\Services\KeyFobAccess $keyFobAccess, EquipmentLogRepository $equipmentLogRepository) |
|
| 31 | + { |
|
| 31 | 32 | $this->acsNodeRepository = $acsNodeRepository; |
| 32 | 33 | $this->ACSValidator = $ACSValidator; |
| 33 | 34 | $this->keyFobAccess = $keyFobAccess; |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php namespace BB\Http\Controllers; |
| 2 | 2 | |
| 3 | 3 | use BB\Entities\ACSNode; |
| 4 | -use BB\Entities\DetectedDevice; |
|
| 5 | 4 | use BB\Entities\User; |
| 6 | 5 | use BB\Events\MemberActivity; |
| 7 | 6 | use BB\Exceptions\ValidationException; |
@@ -235,6 +235,9 @@ |
||
| 235 | 235 | return $this->user; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | + /** |
|
| 239 | + * @return KeyFob |
|
| 240 | + */ |
|
| 238 | 241 | public function lookupKeyFob($keyId) |
| 239 | 242 | { |
| 240 | 243 | try { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $payment_details = array( |
| 38 | 38 | "description" => "Build Brighton", |
| 39 | 39 | 'success_redirect_url' => route('account.subscription.store', $user->id), |
| 40 | - "session_token" => 'user-token-'.$user->id, |
|
| 40 | + "session_token" => 'user-token-' . $user->id, |
|
| 41 | 41 | 'prefilled_customer' => [ |
| 42 | 42 | 'given_name' => $user->given_name, |
| 43 | 43 | 'family_name' => $user->family_name, |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | - if (!isset($confirmed_resource->links->mandate) || empty($confirmed_resource->links->mandate)) { |
|
| 85 | + if ( ! isset($confirmed_resource->links->mandate) || empty($confirmed_resource->links->mandate)) { |
|
| 86 | 86 | \Notification::error('Something went wrong, you can try again or get in contact'); |
| 87 | 87 | return \Redirect::route('account.show', $user->id); |
| 88 | 88 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | if ($paymentMethod === 'balance' && empty($user->payment_method) && in_array($user->status, ['setting-up', 'left', 'leaving'])) { |
| 161 | 161 | // Activate a users membership with a payment method of balance |
| 162 | - $user->payment_method = 'balance'; |
|
| 162 | + $user->payment_method = 'balance'; |
|
| 163 | 163 | $user->secondary_payment_method = null; |
| 164 | 164 | $user->payment_day = Carbon::now()->day; |
| 165 | 165 | $user->save(); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | if ($paymentMethod === 'balance' && $user->payment_method == 'gocardless-variable') { |
| 171 | - $user->payment_method = 'balance'; |
|
| 171 | + $user->payment_method = 'balance'; |
|
| 172 | 172 | $user->secondary_payment_method = 'gocardless-variable'; |
| 173 | 173 | $user->save(); |
| 174 | 174 | } |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php namespace BB\Http\Controllers; |
| 2 | 2 | |
| 3 | 3 | use BB\Entities\Role; |
| 4 | -use BB\Entities\User; |
|
| 5 | 4 | use BB\Validators\RoleUserValidator; |
| 6 | 5 | |
| 7 | 6 | class RoleUsersController extends Controller |