Route problem in multisite

Help for integrating the Laravel package
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!
User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Route problem in multisite

Post by VirtualSpy » 21 Oct 2022, 07:39

Laravel version 9.36.4 , Aimeos version 2022.10.3 and PHP version 8.1.3 (Win)

when i am register new user in multisite .......it is showing

Code: Select all

 Missing required parameter for [Route: verification.verify] [URI: {site}/verify-email/{id}/{hash}] [Missing parameter: site].

User avatar
aimeos
Administrator
Posts: 7941
Joined: 01 Jan 1970, 00:00

Re: Route problem in multisite

Post by aimeos » 24 Oct 2022, 11:03

You must not add the Aimeos "{site}" route placeholder to non-shop routes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Re: Route problem in multisite

Post by VirtualSpy » 25 Oct 2022, 12:13

aimeos wrote: 24 Oct 2022, 11:03 You must not add the Aimeos "{site}" route placeholder to non-shop routes.
I'm sorry, exactly i am not understanding this....and i followed this https://aimeos.org/docs/latest/laravel/ ... he-routing
https://aimeos.org/docs/latest/laravel/ ... /#homepage for routing of multisite

so, please explain in detail

User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Re: Route problem in multisite

Post by VirtualSpy » 26 Oct 2022, 08:06

VirtualSpy wrote: 25 Oct 2022, 12:13
aimeos wrote: 24 Oct 2022, 11:03 You must not add the Aimeos "{site}" route placeholder to non-shop routes.
I'm sorry, exactly i am not understanding this....and i followed this https://aimeos.org/docs/latest/laravel/ ... he-routing
https://aimeos.org/docs/latest/laravel/ ... /#homepage for routing of multisite

so, please explain in detail
Aimeos ! please reply is it bug or i am not understanding only ....according to me it is a bug because there is no config for auth routes

User avatar
aimeos
Administrator
Posts: 7941
Joined: 01 Jan 1970, 00:00

Re: Route problem in multisite

Post by aimeos » 27 Oct 2022, 11:31

Please provide the output of "php artisan route:list", the "routes" section from your ./config/shop.php and the content of your ./routes/web.php file so we can tell you where your mistake is.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Re: Route problem in multisite

Post by VirtualSpy » 27 Oct 2022, 11:50

aimeos wrote: 27 Oct 2022, 11:31 Please provide the output of "php artisan route:list", the "routes" section from your ./config/shop.php and the content of your ./routes/web.php file so we can tell you where your mistake is.

Code: Select all

GET|HEAD  / .............................................................................................................................................. 
  POST      _ignition/execute-solution ....................................... ignition.executeSolution › Spatie\LaravelIgnition › ExecuteSolutionController 
  GET|HEAD  _ignition/health-check ................................................... ignition.healthCheck › Spatie\LaravelIgnition › HealthCheckController 
  POST      _ignition/update-config ................................................ ignition.updateConfig › Spatie\LaravelIgnition › UpdateConfigController 
  GET|HEAD  admin ............................................................................ aimeos_shop_admin › Aimeos\Shop › AdminController@indexAction 
  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|HEAD  admin/{site}/jqadm/copy/{resource}/{id} ...................................... aimeos_shop_jqadm_copy › Aimeos\Shop › JqadmController@copyAction 
  GET|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/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  
  ANY       api/business_api_order_callback ................................................................................................................  
  GET|HEAD  api/user ....................................................................................................................................... 
  GET|HEAD  log-viewer ............................................................. log-viewer::dashboard › Arcanedev\LogViewer › LogViewerController@index  
  GET|HEAD  log-viewer/logs ..................................................... log-viewer::logs.list › Arcanedev\LogViewer › LogViewerController@listLogs  
  DELETE    log-viewer/logs/delete .............................................. log-viewer::logs.delete › Arcanedev\LogViewer › LogViewerController@delete  
  GET|HEAD  log-viewer/logs/{date} .................................................. log-viewer::logs.show › Arcanedev\LogViewer › LogViewerController@show  
  GET|HEAD  log-viewer/logs/{date}/download ................................. log-viewer::logs.download › Arcanedev\LogViewer › LogViewerController@download  
  GET|HEAD  log-viewer/logs/{date}/{level} ................................. log-viewer::logs.filter › Arcanedev\LogViewer › LogViewerController@showByLevel  
  GET|HEAD  log-viewer/logs/{date}/{level}/search ............................... log-viewer::logs.search › Arcanedev\LogViewer › LogViewerController@search  
  ANY       order_conformation/callback ....................................................................................................................  
  GET|HEAD  sanctum/csrf-cookie ................................................................................ Laravel\Sanctum › CsrfCookieController@show  
  ANY       ship_notification/callback .....................................................................................................................  
  ANY       test ...........................................................................................................................................  
  GET|HEAD  tmp_order ...................................................................................................................... tmp_order@index  
  GET|HEAD  tmp_order/xml/{id} ............................................................................................... tmp_order/xml › tmp_order@xml  
  GET|HEAD  {site} ................................................................................ aimeos_home › Aimeos\Shop › CatalogController@homeAction  
  GET|HEAD  {site}/confirm-password ............................................................. password.confirm › Auth\ConfirmablePasswordController@show  
  POST      {site}/confirm-password ............................................................................... Auth\ConfirmablePasswordController@store  
  POST      {site}/email/verification-notification .................................. verification.send › Auth\EmailVerificationNotificationController@store  
  GET|HEAD  {site}/forgot-password .............................................................. password.request › Auth\PasswordResetLinkController@create  
  POST      {site}/forgot-password ................................................................. password.email › Auth\PasswordResetLinkController@store  
  GET|OPTIONS|HEAD {site}/jsonapi/{resource?} .................................. aimeos_shop_jsonapi_options › Aimeos\Shop › JsonapiController@optionsAction
  DELETE    {site}/jsonapi/{resource} ............................................ aimeos_shop_jsonapi_delete › Aimeos\Shop › JsonapiController@deleteAction  
  GET|HEAD  {site}/jsonapi/{resource} .................................................. aimeos_shop_jsonapi_get › Aimeos\Shop › JsonapiController@getAction  
  PATCH     {site}/jsonapi/{resource} .............................................. aimeos_shop_jsonapi_patch › Aimeos\Shop › JsonapiController@patchAction  
  POST      {site}/jsonapi/{resource} ................................................ aimeos_shop_jsonapi_post › Aimeos\Shop › JsonapiController@postAction  
  PUT       {site}/jsonapi/{resource} .................................................. aimeos_shop_jsonapi_put › Aimeos\Shop › JsonapiController@putAction  
  GET|HEAD  {site}/login ................................................................................ login › Auth\AuthenticatedSessionController@create  
  POST      {site}/login ......................................................................................... Auth\AuthenticatedSessionController@store  
  POST      {site}/logout ............................................................................. logout › Auth\AuthenticatedSessionController@destroy  
  GET|POST|HEAD {site}/p/{path?} .................................................................... aimeos_page › Aimeos\Shop › PageController@indexAction  
  GET|POST|HEAD {site}/profile ........................................................... aimeos_shop_account › Aimeos\Shop › AccountController@indexAction  
  GET|POST|HEAD {site}/profile/download/{dl_id} .............................. aimeos_shop_account_download › Aimeos\Shop › AccountController@downloadAction  
  GET|POST|HEAD {site}/profile/favorite/{fav_action?}/{fav_id?}/{d_name?}/{d_pos?} aimeos_shop_account_favorite › Aimeos\Shop › AccountController@indexActi…  
  GET|POST|HEAD {site}/profile/watch/{wat_action?}/{wat_id?}/{d_name?}/{d_pos?} .... aimeos_shop_account_watch › Aimeos\Shop › AccountController@indexAction  
  GET|HEAD  {site}/register ................................................................................ register › Auth\RegisteredUserController@create  
  POST      {site}/register ............................................................................................ Auth\RegisteredUserController@store  
  POST      {site}/reset-password ....................................................................... password.update › Auth\NewPasswordController@store  
  GET|HEAD  {site}/reset-password/{token} ............................................................... password.reset › Auth\NewPasswordController@create  
  GET|POST|HEAD {site}/s/{s_name}/{f_supid} ........................................... aimeos_shop_supplier › Aimeos\Shop › SupplierController@detailAction
  GET|POST|HEAD {site}/shop .................................................................. aimeos_shop_list › Aimeos\Shop › CatalogController@listAction  
  GET|POST|HEAD {site}/shop/basket ......................................................... aimeos_shop_basket › Aimeos\Shop › BasketController@indexAction  
  GET|POST|HEAD {site}/shop/checkout/{c_step?} ......................................... aimeos_shop_checkout › Aimeos\Shop › CheckoutController@indexAction  
  GET|POST|HEAD {site}/shop/confirm/{code?} ........................................... aimeos_shop_confirm › Aimeos\Shop › CheckoutController@confirmAction  
  GET|POST|HEAD {site}/shop/count .......................................................... aimeos_shop_count › Aimeos\Shop › CatalogController@countAction  
  GET|POST|HEAD {site}/shop/pin ................................................. aimeos_shop_session_pinned › Aimeos\Shop › CatalogController@sessionAction  
  GET|POST|HEAD {site}/shop/stock .......................................................... aimeos_shop_stock › Aimeos\Shop › CatalogController@stockAction  
  GET|POST|HEAD {site}/shop/suggest .................................................... aimeos_shop_suggest › Aimeos\Shop › CatalogController@suggestAction  
  GET|POST|HEAD {site}/shop/{d_name}/{d_pos?}/{d_prodid?} ................................ aimeos_shop_detail › Aimeos\Shop › CatalogController@detailAction  
  GET|POST|HEAD {site}/shop/{f_name}~{f_catid}/{l_page?} ..................................... aimeos_shop_tree › Aimeos\Shop › CatalogController@treeAction  
  GET|POST|HEAD {site}/update ........................................................... aimeos_shop_update › Aimeos\Shop › CheckoutController@updateAction  
  GET|HEAD  {site}/verify-email ...................................................... verification.notice › Auth\EmailVerificationPromptController@__invoke  
  GET|HEAD  {site}/verify-email/{id}/{hash} ...................................................... verification.verify › Auth\VerifyEmailController@__invoke  

Code: Select all

 'routes' => [
        // Docs: https://aimeos.org/docs/latest/laravel/extend/#custom-routes
        // Multi-sites: https://aimeos.org/docs/latest/laravel/customize/#multiple-shops
        'admin' => ['prefix' => 'admin', 'middleware' => ['web']],
        'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']],
        'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']],
        'jsonapi' => ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
        'account' => ['prefix' => $prefix . 'profile', 'middleware' => ['web', 'auth']],
        'default' => ['prefix' => $prefix . 'shop', 'middleware' => ['web']],
        'supplier' => ['prefix' => $prefix . 's', 'middleware' => ['web']],
        'page' => ['prefix' => $prefix . 'p', 'middleware' => ['web']],
        'home' => ['prefix' => $prefix, 'middleware' => ['web']],
        'update' => [],
    ],

Code: Select all

<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;

use App\Http\Controllers\tmp_order;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//Test
//  Test ""

$params = [];
$conf = ['prefix' => '', 'where' => []];

Route::any('order_conformation/callback', function () {
    $val =  glob("./order_confirmation/*");

    foreach ($val as $data) {
        $result = file_get_contents($data);
       
        echo "<pre>";
            htmlspecialchars ($result);
        echo "</pre> <br>";
       
    }
});

Route::any('ship_notification/callback', function () {

    $val =  glob("./ship_notification/*");

    foreach ($val as $data) {
        $result = file_get_contents($data);
        
        echo "<pre>";
            htmlspecialchars($result);
        echo "</pre> <br>";
    }
});


Route::any("test", function () {

    dd(public_path() . " <- public path - base_path ->  " . base_path());
});

if (env('SHOP_MULTILOCALE')) {
    $conf['prefix'] .= '{locale}';
    $conf['where']['locale'] = '[a-z]{2}(\_[A-Z]{2})?';
    $params = ['locale' => app()->getLocale()];

    Route::get('/admin', function () use ($params) {
        return redirect(airoute('aimeos_shop_admin', $params));
    });
}

if (env('SHOP_MULTISHOP')) {
    $conf['prefix'] .= '/{site}';
    $conf['where']['site'] = '[A-Za-z0-9\.\-]+';
}

if ($conf['prefix']) {
    Route::get('/', function () use ($params) {
        return redirect(airoute('aimeos_home', $params));
    });
}

Route::group($conf ?? [], function () {
    require __DIR__ . '/auth.php';
});
Route::group(['prefix' => '{site}', 'middleware' => ['web']], function () {
    Route::get('/', '\Aimeos\Shop\Controller\CatalogController@homeAction')
        ->name('aimeos_home')->where( ['site' => '[a-z0-9\-]+'] );
});

Route::get('tmp_order','App\Http\Controllers\tmp_order@index',);
Route::get('tmp_order/xml/{id}','App\Http\Controllers\tmp_order@xml')->name('tmp_order/xml');

User avatar
aimeos
Administrator
Posts: 7941
Joined: 01 Jan 1970, 00:00

Re: Route problem in multisite

Post by aimeos » 27 Oct 2022, 11:58

These are the routes that causes problems because they contain the "site" route parameter:

Code: Select all

  GET|HEAD  {site}/confirm-password ............................................................. password.confirm › Auth\ConfirmablePasswordController@show  
  POST      {site}/confirm-password ............................................................................... Auth\ConfirmablePasswordController@store  
  POST      {site}/email/verification-notification .................................. verification.send › Auth\EmailVerificationNotificationController@store  
  GET|HEAD  {site}/forgot-password .............................................................. password.request › Auth\PasswordResetLinkController@create  
  POST      {site}/forgot-password ................................................................. password.email › Auth\PasswordResetLinkController@store  
This is due to the ./routes/web.php file:

Code: Select all

Route::group($conf ?? [], function () {
    require __DIR__ . '/auth.php';
});
The root cause for the error is that the links to the auth routes are not generated by the airoute() function in your templates like here:
https://github.com/aimeos/aimeos/blob/m ... ade.php#L9
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Re: Route problem in multisite

Post by VirtualSpy » 27 Oct 2022, 13:10

aimeos wrote: 27 Oct 2022, 11:58 These are the routes that causes problems because they contain the "site" route parameter:

Code: Select all

  GET|HEAD  {site}/confirm-password ............................................................. password.confirm › Auth\ConfirmablePasswordController@show  
  POST      {site}/confirm-password ............................................................................... Auth\ConfirmablePasswordController@store  
  POST      {site}/email/verification-notification .................................. verification.send › Auth\EmailVerificationNotificationController@store  
  GET|HEAD  {site}/forgot-password .............................................................. password.request › Auth\PasswordResetLinkController@create  
  POST      {site}/forgot-password ................................................................. password.email › Auth\PasswordResetLinkController@store  
This is due to the ./routes/web.php file:

Code: Select all

Route::group($conf ?? [], function () {
    require __DIR__ . '/auth.php';
});
The root cause for the error is that the links to the auth routes are not generated by the airoute() function in your templates like here:
https://github.com/aimeos/aimeos/blob/m ... ade.php#L9
I know which routes are causing .....so i want to know it's solution ....please tell me it's solution

User avatar
aimeos
Administrator
Posts: 7941
Joined: 01 Jan 1970, 00:00

Re: Route problem in multisite

Post by aimeos » 27 Oct 2022, 13:52

Read:

The root cause for the error is that the links to the auth routes are not generated by the airoute() function in your templates like here:
https://github.com/aimeos/aimeos/blob/m ... ade.php#L9
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
VirtualSpy
Advanced
Posts: 122
Joined: 05 Jul 2022, 07:55

Re: Route problem in multisite

Post by VirtualSpy » 27 Oct 2022, 14:00

aimeos wrote: 27 Oct 2022, 13:52 Read:

The root cause for the error is that the links to the auth routes are not generated by the airoute() function in your templates like here:
https://github.com/aimeos/aimeos/blob/m ... ade.php#L9
already airoute() function is here in this template

Code: Select all

<x-guest-layout>
    <x-auth-card>
        <!-- Validation Errors -->
        <x-auth-validation-errors class="mb-4" :errors="$errors" />

        <form method="POST" action="{{ airoute('register') }}">
            @csrf

            <!-- Name -->
            <div>
                <x-label for="name" :value="__('Name')" />

                <x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
            </div>

            <!-- Email Address -->
            <div class="mt-4">
                <x-label for="email" :value="__('Email')" />

                <x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
            </div>

            <!-- Password -->
            <div class="mt-4">
                <x-label for="password" :value="__('Password')" />

                <x-input id="password" class="block mt-1 w-full"
                                type="password"
                                name="password"
                                required autocomplete="new-password" />
            </div>

            <!-- Confirm Password -->
            <div class="mt-4">
                <x-label for="password_confirmation" :value="__('Confirm Password')" />

                <x-input id="password_confirmation" class="block mt-1 w-full"
                                type="password"
                                name="password_confirmation" required />
            </div>

            <div class="flex items-center justify-end mt-4">
                <a class="underline text-sm text-gray-600 hover:text-gray-900" href="{{ airoute('login') }}">
                    {{ __('Already registered?') }}
                </a>

                <x-button class="ml-4">
                    {{ __('Register') }}
                </x-button>
            </div>
        </form>
    </x-auth-card>
</x-guest-layout>

Post Reply