Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Use ::class notations for routes controllers (#841)
Browse files Browse the repository at this point in the history
* Use class notation.

* StyleCI fix.
  • Loading branch information
lucasmichot authored Jun 24, 2021
1 parent a133fed commit c3e7a0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions src/ShopifyApp/resources/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

use Illuminate\Support\Facades\Route;
use function Osiset\ShopifyApp\getShopifyConfig;
use Osiset\ShopifyApp\Http\Controllers\ApiController;
use Osiset\ShopifyApp\Http\Controllers\WebhookController;
use function Osiset\ShopifyApp\registerPackageRoute;

// Check if manual routes override is to be use
Expand All @@ -26,17 +28,17 @@
Route::group(['prefix' => 'api', 'middleware' => ['auth.token']], function () {
Route::get(
'/',
'Osiset\ShopifyApp\Http\Controllers\ApiController@index'
ApiController::class.'@index'
);

Route::get(
'/me',
'Osiset\ShopifyApp\Http\Controllers\ApiController@getSelf'
ApiController::class.'@getSelf'
);

Route::get(
'/plans',
'Osiset\ShopifyApp\Http\Controllers\ApiController@getPlans'
ApiController::class.'@getPlans'
);
});
}
Expand All @@ -53,7 +55,7 @@
if (registerPackageRoute('webhook', $manualRoutes)) {
Route::post(
'/webhook/{type}',
'Osiset\ShopifyApp\Http\Controllers\WebhookController@handle'
WebhookController::class.'@handle'
)
->middleware('auth.webhook')
->name(getShopifyConfig('route_names.webhook'));
Expand Down
20 changes: 12 additions & 8 deletions src/ShopifyApp/resources/routes/shopify.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

use Illuminate\Support\Facades\Route;
use function Osiset\ShopifyApp\getShopifyConfig;
use Osiset\ShopifyApp\Http\Controllers\AuthController;
use Osiset\ShopifyApp\Http\Controllers\BillingController;
use Osiset\ShopifyApp\Http\Controllers\HomeController;
use Osiset\ShopifyApp\Http\Controllers\ItpController;
use function Osiset\ShopifyApp\registerPackageRoute;

// Check if manual routes override is to be use
Expand All @@ -36,7 +40,7 @@
if (registerPackageRoute('home', $manualRoutes)) {
Route::get(
'/',
'Osiset\ShopifyApp\Http\Controllers\HomeController@index'
HomeController::class.'@index'
)
->middleware(['auth.shopify', 'billable'])
->name(getShopifyConfig('route_names.home'));
Expand All @@ -52,12 +56,12 @@
*/

if (registerPackageRoute('itp', $manualRoutes)) {
Route::get('/itp', 'Osiset\ShopifyApp\Http\Controllers\ItpController@attempt')
Route::get('/itp', ItpController::class.'@attempt')
->name(getShopifyConfig('route_names.itp'));
}

if (registerPackageRoute('itp.ask', $manualRoutes)) {
Route::get('/itp/ask', 'Osiset\ShopifyApp\Http\Controllers\ItpController@ask')
Route::get('/itp/ask', ItpController::class.'@ask')
->name(getShopifyConfig('route_names.itp.ask'));
}
});
Expand All @@ -77,7 +81,7 @@
Route::match(
['get', 'post'],
'/authenticate',
'Osiset\ShopifyApp\Http\Controllers\AuthController@authenticate'
AuthController::class.'@authenticate'
)
->name(getShopifyConfig('route_names.authenticate'));
}
Expand All @@ -94,7 +98,7 @@
if (registerPackageRoute('authenticate.oauth', $manualRoutes)) {
Route::get(
'/authenticate/oauth',
'Osiset\ShopifyApp\Http\Controllers\AuthController@oauth'
AuthController::class.'@oauth'
)
->name(getShopifyConfig('route_names.authenticate.oauth'));
}
Expand All @@ -111,7 +115,7 @@
if (registerPackageRoute('billing', $manualRoutes)) {
Route::get(
'/billing/{plan?}',
'Osiset\ShopifyApp\Http\Controllers\BillingController@index'
BillingController::class.'@index'
)
->middleware(['auth.shopify'])
->where('plan', '^([0-9]+|)$')
Expand All @@ -130,7 +134,7 @@
if (registerPackageRoute('billing.process', $manualRoutes)) {
Route::get(
'/billing/process/{plan?}',
'Osiset\ShopifyApp\Http\Controllers\BillingController@process'
BillingController::class.'@process'
)
->middleware(['auth.shopify'])
->where('plan', '^([0-9]+|)$')
Expand All @@ -150,7 +154,7 @@
Route::match(
['get', 'post'],
'/billing/usage-charge',
'Osiset\ShopifyApp\Http\Controllers\BillingController@usageCharge'
BillingController::class.'@usageCharge'
)
->middleware(['auth.shopify'])
->name(getShopifyConfig('route_names.billing.usage_charge'));
Expand Down

0 comments on commit c3e7a0d

Please sign in to comment.