This commit is contained in:
Maxime Renou 2020-05-12 14:09:08 +02:00
parent 38066dd0cb
commit 3895fbdb26
2 changed files with 15 additions and 5 deletions

View File

@ -378,16 +378,17 @@ class Connect
public function routes() public function routes()
{ {
Route::middleware('web') Route::namespace('\Bluesquare\Connect\Controllers')
->namespace('\Bluesquare\Connect\Controllers')
->group(function () { ->group(function () {
Route::get('connect/authorize', 'ConnectController@authorize'); Route::get('connect/authorize', 'ConnectController@authorize');
Route::get('connect/callback', 'ConnectController@callback'); Route::get('connect/callback', 'ConnectController@callback');
}); });
}
Route::prefix('api') public function apiRoutes()
->middleware('api') {
->namespace('\Bluesquare\Connect\Controllers') Route::namespace('\Bluesquare\Connect\Controllers')
->prefix('api')
->group(function () { ->group(function () {
Route::post('connect/webhook', 'ConnectController@webhook'); Route::post('connect/webhook', 'ConnectController@webhook');
}); });

View File

@ -14,4 +14,13 @@ class Connect extends Facade
{ {
static::$app->make(\Bluesquare\Connect\Connect::class)->routes(); static::$app->make(\Bluesquare\Connect\Connect::class)->routes();
} }
/**
* Register the typical Connect API routes for an application.
* @return void
*/
public static function apiRoutes()
{
static::$app->make(\Bluesquare\Connect\Connect::class)->apiRoutes();
}
} }