Override Shop route to give main HomesController Route back control
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Override Shop route to give main HomesController Route back control
Now I need to see how I can load the view for the domein.nl shop in the backend. When I check the routes for Aimeos based routes I get these:
I would like to override the home route as it seems to override
So I tried adding
and cleared route cache and reloaded list, but it does not seem to help as of yet.
Also wonder if there is a way to just copy over routes to web.php so we have all there and can manipulate them like I did with Jetstream and Fortify . Now there are two places to look for routes and the Aimeos one is at vendor/aimeos/aimeos-laravel/routes/aimeos.php
Basically I want to turn off all Aimeos frontend routes as we want to use our own. That and only use admin route overrides and JSON calls (get data into Vue components). This override is just one look at things.
Code: Select all
php artisan route:list
GET|POST|HEAD / ................................................................................................. aimeos_home › Aimeos\Shop › CatalogController@homeAction
...
POST admin/{site}/graphql ................................................................ aimeos_shop_graphql_post › Aimeos\Shop › GraphqlController@indexAction
POST admin/{site}/jqadm/batch/{resource} .................................................... aimeos_shop_jqadm_batch › Aimeos\Shop › JqadmController@batchAction
GET|POST|HEAD admin/{site}/jqadm/copy/{resource}/{id} .................................................. aimeos_shop_jqadm_copy › Aimeos\Shop › JqadmController@copyAction
GET|POST|HEAD admin/{site}/jqadm/create/{resource} ................................................. aimeos_shop_jqadm_create › Aimeos\Shop › JqadmController@createAction
POST admin/{site}/jqadm/delete/{resource}/{id?} ........................................... aimeos_shop_jqadm_delete › Aimeos\Shop › JqadmController@deleteAction
GET|POST|HEAD admin/{site}/jqadm/export/{resource} ................................................. aimeos_shop_jqadm_export › Aimeos\Shop › JqadmController@exportAction
GET|HEAD admin/{site}/jqadm/file/{type} ........................................................... aimeos_shop_jqadm_file › Aimeos\Shop › JqadmController@fileAction
GET|HEAD admin/{site}/jqadm/get/{resource}/{id} ..................................................... aimeos_shop_jqadm_get › Aimeos\Shop › JqadmController@getAction
POST admin/{site}/jqadm/import/{resource} ................................................. aimeos_shop_jqadm_import › Aimeos\Shop › JqadmController@importAction
POST admin/{site}/jqadm/save/{resource} ....................................................... aimeos_shop_jqadm_save › Aimeos\Shop › JqadmController@saveAction
GET|POST|HEAD admin/{site}/jqadm/search/{resource} ................................................. aimeos_shop_jqadm_search › Aimeos\Shop › JqadmController@searchAction
OPTIONS admin/{site}/jsonadm/{resource?} ............................................... aimeos_shop_jsonadm_options › Aimeos\Shop › JsonadmController@optionsAction
DELETE admin/{site}/jsonadm/{resource}/{id?} ............................................ aimeos_shop_jsonadm_delete › Aimeos\Shop › JsonadmController@deleteAction
GET|HEAD admin/{site}/jsonadm/{resource}/{id?} .................................................. aimeos_shop_jsonadm_get › Aimeos\Shop › JsonadmController@getAction
PATCH admin/{site}/jsonadm/{resource}/{id?} .............................................. aimeos_shop_jsonadm_patch › Aimeos\Shop › JsonadmController@patchAction
POST admin/{site}/jsonadm/{resource}/{id?} ................................................ aimeos_shop_jsonadm_post › Aimeos\Shop › JsonadmController@postAction
PUT admin/{site}/jsonadm/{resource}/{id?} .................................................. aimeos_shop_jsonadm_put › Aimeos\Shop › JsonadmController@putAction
GET|HEAD api/extend-module/{type}/component .......................................................................... Published\ModulesController@getExtendComponent
...
GET|OPTIONS|HEAD jsonapi/{resource?} ........................................................... aimeos_shop_jsonapi_options › Aimeos\Shop › JsonapiController@optionsAction
DELETE jsonapi/{resource} ............................................................... aimeos_shop_jsonapi_delete › Aimeos\Shop › JsonapiController@deleteAction
GET|HEAD jsonapi/{resource} ..................................................................... aimeos_shop_jsonapi_get › Aimeos\Shop › JsonapiController@getAction
PATCH jsonapi/{resource} ................................................................. aimeos_shop_jsonapi_patch › Aimeos\Shop › JsonapiController@patchAction
POST jsonapi/{resource} ................................................................... aimeos_shop_jsonapi_post › Aimeos\Shop › JsonapiController@postAction
PUT jsonapi/{resource} ..................................................................... aimeos_shop_jsonapi_put › Aimeos\Shop › JsonapiController@putAction
...
GET|POST|HEAD profile .................................................................................. aimeos_shop_account › Aimeos\Shop › AccountController@indexAction
GET|POST|HEAD profile/download/{dl_id} ..................................................... aimeos_shop_account_download › Aimeos\Shop › AccountController@downloadAction
GET|POST|HEAD profile/favorite/{fav_action?}/{fav_id?}/{d_name?}/{d_pos?} ..................... aimeos_shop_account_favorite › Aimeos\Shop › AccountController@indexAction
GET|POST|HEAD profile/watch/{wat_action?}/{wat_id?}/{d_name?}/{d_pos?} ........................... aimeos_shop_account_watch › Aimeos\Shop › AccountController@indexAction
...
GET|POST|HEAD shop ......................................................................................... aimeos_shop_list › Aimeos\Shop › CatalogController@listAction
GET|POST|HEAD shop/basket ................................................................................ aimeos_shop_basket › Aimeos\Shop › BasketController@indexAction
GET|POST|HEAD shop/checkout/{c_step?} ................................................................ aimeos_shop_checkout › Aimeos\Shop › CheckoutController@indexAction
GET|POST|HEAD shop/confirm/{code?} .................................................................. aimeos_shop_confirm › Aimeos\Shop › CheckoutController@confirmAction
GET|POST|HEAD shop/count ................................................................................. aimeos_shop_count › Aimeos\Shop › CatalogController@countAction
GET|POST|HEAD shop/pin ........................................................................ aimeos_shop_session_pinned › Aimeos\Shop › CatalogController@sessionAction
GET|POST|HEAD shop/stock ................................................................................. aimeos_shop_stock › Aimeos\Shop › CatalogController@stockAction
GET|POST|HEAD shop/suggest ........................................................................... aimeos_shop_suggest › Aimeos\Shop › CatalogController@suggestAction
GET|POST|HEAD shop/{d_name}/{d_pos?}/{d_prodid?} ....................................................... aimeos_shop_detail › Aimeos\Shop › CatalogController@detailAction
GET|POST|HEAD shop/{f_name}~{f_catid}/{l_page?} ............................................................ aimeos_shop_tree › Aimeos\Shop › CatalogController@treeAction
...
GET|POST|HEAD supplier/{s_name}/{f_supid} ........................................................... aimeos_shop_supplier › Aimeos\Shop › SupplierController@detailAction
...
GET|POST|HEAD update .................................................................................. aimeos_shop_update › Aimeos\Shop › CheckoutController@updateAction
Code: Select all
GET|HEAD
GET|POST|HEAD / ................................................................................................. aimeos_home › Aimeos\Shop › CatalogController@homeAction
GET|HEAD smtv.test/ ........................................................................................................................... HomesController@index
Code: Select all
...
Route::domain(config('name.app_domain'))->group(function () {
Route::get('/sitemap.xml', [Published\SiteController::class, 'generateSitemap']);
Route::match( array( 'GET', 'POST' ), '/', array(
'as' => 'aimeos_home',
// 'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction'
'uses' => 'App\Http\Controllers\HomesController@index'
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
Route::get('/', [HomesController::class, 'index']);
...
Also wonder if there is a way to just copy over routes to web.php so we have all there and can manipulate them like I did with Jetstream and Fortify . Now there are two places to look for routes and the Aimeos one is at vendor/aimeos/aimeos-laravel/routes/aimeos.php
Basically I want to turn off all Aimeos frontend routes as we want to use our own. That and only use admin route overrides and JSON calls (get data into Vue components). This override is just one look at things.
Re: Override Shop route to give main HomesController Route back control
I turned off home in shop.php
then I did
Then the home route got turned off. I had to cache configuration again as I updated shop.php config file. I forgot. Now I need to see how I can turn off all other frontend routes as I want to load product data, checkout, cart data into Vue components.
Code: Select all
'routes' => [
...
// 'default' => ['prefix' => 'shop', 'middleware' => ['web']],
// 'confirm' => ['prefix' => 'shop', 'middleware' => ['web']],
// 'supplier' => ['prefix' => 's', 'middleware' => ['web']],
// 'page' => ['prefix' => 'p', 'middleware' => ['web']],
// 'home' => ['middleware' => ['web']],
'home' => false,
// 'update' => [],
],
...
Code: Select all
php artisan config: cache
php artisan route:clear
Re: Override Shop route to give main HomesController Route back control
Code: Select all
php artisan route:list --path=shop
GET|POST|HEAD shop ..................................................................................... aimeos_shop_list › Aimeos\Shop › CatalogController@listAction
GET|POST|HEAD shop/basket ............................................................................ aimeos_shop_basket › Aimeos\Shop › BasketController@indexAction
GET|POST|HEAD shop/checkout/{c_step?} ............................................................ aimeos_shop_checkout › Aimeos\Shop › CheckoutController@indexAction
GET|POST|HEAD shop/confirm/{code?} .............................................................. aimeos_shop_confirm › Aimeos\Shop › CheckoutController@confirmAction
GET|POST|HEAD shop/count ............................................................................. aimeos_shop_count › Aimeos\Shop › CatalogController@countAction
GET|POST|HEAD shop/pin .................................................................... aimeos_shop_session_pinned › Aimeos\Shop › CatalogController@sessionAction
GET|POST|HEAD shop/stock ............................................................................. aimeos_shop_stock › Aimeos\Shop › CatalogController@stockAction
GET|POST|HEAD shop/suggest ....................................................................... aimeos_shop_suggest › Aimeos\Shop › CatalogController@suggestAction
GET|POST|HEAD shop/{d_name}/{d_pos?}/{d_prodid?} ................................................... aimeos_shop_detail › Aimeos\Shop › CatalogController@detailAction
GET|POST|HEAD shop/{f_name}~{f_catid}/{l_page?} ........................................................ aimeos_shop_tree › Aimeos\Shop › CatalogController@treeAction
Code: Select all
// 'default' => ['prefix' => 'shop', 'middleware' => ['web']],
'default' => false,
// 'confirm' => ['prefix' => 'shop', 'middleware' => ['web']],
'confirm' => false,
Re: Override Shop route to give main HomesController Route back control
You can turn off all route groups from Aimeos by setting them to "false" in the ./config/shop.php like you did. If you want to use a VueJS based PWA as frontend, use the JSON:API for interacting with Aimeos:
https://aimeos.org/docs/latest/frontend/jsonapi/
https://aimeos.org/docs/latest/frontend/jsonapi/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
