@@ -54,7 +54,7 @@ |
||
| 54 | 54 | public function getHasValidAccessTokenAttribute() |
| 55 | 55 | { |
| 56 | 56 | return $this->access_token_expires_at && Carbon::now() |
| 57 | - ->lt($this->access_token_expires_at); |
|
| 57 | + ->lt($this->access_token_expires_at); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -83,21 +83,21 @@ |
||
| 83 | 83 | $config = $this->app->config->get('quickbooks.route'); |
| 84 | 84 | |
| 85 | 85 | $this->app->router->prefix($config['prefix']) |
| 86 | - ->as('quickbooks.') |
|
| 87 | - ->middleware($config['middleware']['default']) |
|
| 88 | - ->namespace('Spinen\QuickBooks\Http\Controllers') |
|
| 89 | - ->group(function (Router $router) use ($config) { |
|
| 90 | - $router->get($config['paths']['connect'], 'Controller@connect') |
|
| 91 | - ->middleware($config['middleware']['authenticated']) |
|
| 92 | - ->name('connect'); |
|
| 93 | - |
|
| 94 | - $router->delete($config['paths']['disconnect'], 'Controller@disconnect') |
|
| 95 | - ->middleware($config['middleware']['authenticated']) |
|
| 96 | - ->name('disconnect'); |
|
| 97 | - |
|
| 98 | - $router->get($config['paths']['token'], 'Controller@token') |
|
| 99 | - ->name('token'); |
|
| 100 | - }); |
|
| 86 | + ->as('quickbooks.') |
|
| 87 | + ->middleware($config['middleware']['default']) |
|
| 88 | + ->namespace('Spinen\QuickBooks\Http\Controllers') |
|
| 89 | + ->group(function (Router $router) use ($config) { |
|
| 90 | + $router->get($config['paths']['connect'], 'Controller@connect') |
|
| 91 | + ->middleware($config['middleware']['authenticated']) |
|
| 92 | + ->name('connect'); |
|
| 93 | + |
|
| 94 | + $router->delete($config['paths']['disconnect'], 'Controller@disconnect') |
|
| 95 | + ->middleware($config['middleware']['authenticated']) |
|
| 96 | + ->name('disconnect'); |
|
| 97 | + |
|
| 98 | + $router->get($config['paths']['token'], 'Controller@token') |
|
| 99 | + ->name('token'); |
|
| 100 | + }); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ->exchangeAuthorizationCodeForToken($code, $realm_id); |
| 124 | 124 | |
| 125 | 125 | $this->getDataService() |
| 126 | - ->updateOAuth2Token($oauth_token); |
|
| 126 | + ->updateOAuth2Token($oauth_token); |
|
| 127 | 127 | |
| 128 | 128 | $this->token->parseOauthToken($oauth_token) |
| 129 | 129 | ->save(); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | if (!$this->hasValidAccessToken() || !isset($this->report_service)) { |
| 166 | 166 | $this->report_service = new ReportService( |
| 167 | 167 | $this->getDataService() |
| 168 | - ->getServiceContext() |
|
| 168 | + ->getServiceContext() |
|
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | $this->app->bind(Client::class, function (Application $app) { |
| 43 | 43 | $token = ($app->auth->user()->quickBooksToken) |
| 44 | 44 | ? : $app->auth->user() |
| 45 | - ->quickBooksToken() |
|
| 46 | - ->make(); |
|
| 45 | + ->quickBooksToken() |
|
| 46 | + ->make(); |
|
| 47 | 47 | |
| 48 | 48 | return new Client($app->config->get('quickbooks'), $token); |
| 49 | 49 | }); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | if ($quickbooks->hasValidRefreshToken()) { |
| 37 | 37 | return $view_factory->make('quickbooks::disconnect') |
| 38 | 38 | ->with('company', $quickbooks->getDataService() |
| 39 | - ->getCompanyInfo()); |
|
| 39 | + ->getCompanyInfo()); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Give view to link account |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | // TODO: Figure out where to put this in session & remove Facade |
| 61 | 61 | Alert::success('Disconnected from QuickBooks') |
| 62 | - ->flash(); |
|
| 62 | + ->flash(); |
|
| 63 | 63 | |
| 64 | 64 | return $redirector->back(); |
| 65 | 65 | } |
@@ -85,6 +85,6 @@ discard block |
||
| 85 | 85 | $quickbooks->exchangeCodeForToken($request->get('code'), $request->get('realmId')); |
| 86 | 86 | |
| 87 | 87 | return $redirector->intended($url_generator->route('quickbooks.connect')) |
| 88 | - ->with('success', 'Connected to QuickBooks'); |
|
| 88 | + ->with('success', 'Connected to QuickBooks'); |
|
| 89 | 89 | } |
| 90 | 90 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | Schema::create('quickbooks_tokens', function (Blueprint $table) { |
| 18 | 18 | $user_id_type = DB::getSchemaBuilder() |
| 19 | - ->getColumnType('users', 'id') === 'bigint' ? 'unsignedBigInteger' : 'unsignedInteger'; |
|
| 19 | + ->getColumnType('users', 'id') === 'bigint' ? 'unsignedBigInteger' : 'unsignedInteger'; |
|
| 20 | 20 | |
| 21 | 21 | $table->unsignedBigInteger('id'); |
| 22 | 22 | $table->{$user_id_type}('user_id'); |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | $table->timestamps(); |
| 30 | 30 | |
| 31 | 31 | $table->foreign('user_id') |
| 32 | - ->references('id') |
|
| 33 | - ->on('users') |
|
| 34 | - ->onDelete('cascade'); |
|
| 32 | + ->references('id') |
|
| 33 | + ->on('users') |
|
| 34 | + ->onDelete('cascade'); |
|
| 35 | 35 | }); |
| 36 | 36 | } |
| 37 | 37 | |