Links at views going to root

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!
daniel.groppo
Posts: 6
Joined: 17 Sep 2016, 07:22

Links at views going to root

Post by daniel.groppo » 17 Sep 2016, 08:18

Hello,

I'm beginner with Aimeos at Laravel 5.2. I have followed every step of installation documentation (including auth steps for Laravel 5.2). I already searched in many communities about my problem, but I'm no finding anything.

I'm using XAMPP with PHP 5.6 and my application is located at C:/xamp/htdocs/myapp/ - I modified the .env file to recognize the myapp folder (APP_URL=http://localhost/myapp). When I execute Request::root() its returns localhost/myapp/public (ok!).

When I type the address in the browser, it works perfectly (Example: localhost/myapp/public/list). But my problems are the Aimeos links. Example: when I click in one product item, it opens http://localhost/detail/1/Demo_article/0. The same occurs when I click anything else, like Basket (http://localhost/basket).

Am I doing anything wrong?

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

Re: Links at views going to root

Post by aimeos » 17 Sep 2016, 09:30

Laravel requires your ./public/ directory to be the document root so http://localhost/ will return the Laravel welcome page. Then, the Aimeos links will work as expected.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

daniel.groppo
Posts: 6
Joined: 17 Sep 2016, 07:22

Re: Links at views going to root

Post by daniel.groppo » 17 Sep 2016, 16:10

Thanks for your reply, but is it possible to use Aimeos inside a subdirectory like 'myapp'? Its because I have many others Laravel applications inside the localhost (even these apps works well with subdirectory), and in the future I want to create others Aimeos app in my local server.

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

Re: Links at views going to root

Post by aimeos » 17 Sep 2016, 17:24

That's a good question. Aimeos doesn't make any assumptions about the URLs and leaves everything to the Laravel router. If you can convince the Laravel router to generate URLs which includes the subdirectories, it will work. Then you only have to adapt the directories for the Aimeos content in the config file.

You should be aware that there may be security problems if you store your Laravel application in a subdirectory because e.g. the log and session files are then available in public.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

daniel.groppo
Posts: 6
Joined: 17 Sep 2016, 07:22

Re: Links at views going to root

Post by daniel.groppo » 17 Sep 2016, 18:46

Thank you again for your reply. I did not know about these security problems. I created a virtual host in my local environment and my problem was partially solved.

Now I can acess http://myapp/list and all the links are working. But when I login (http://myapp/admin), I'm redirected to http://myapp/jqadm/search/dashboard, and the following exception is displayed:

Code: Select all

HttpException in Handler.php line 107:
This action is unauthorized.
And when I type http://myappp/jqadm or http://myapp/extadm, the following exception is displayed:

Code: Select all

NotFoundHttpException in RouteCollection.php line 161:
I thought that these errors were due to the previously reported problem, but have not been resolved. Am I doing anything wrong again?

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

Re: Links at views going to root

Post by aimeos » 17 Sep 2016, 20:23

Did you create the user account with

Code: Select all

./artisan aimeos:account --admin you@example.com
If you only register users, they don't have access to the admin interface.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

daniel.groppo
Posts: 6
Joined: 17 Sep 2016, 07:22

Re: Links at views going to root

Post by daniel.groppo » 17 Sep 2016, 21:23

Yes, I executed the command, but I had the same problem of bruno: https://github.com/aimeos/aimeos-laravel/issues/62

The connection with database is working. I did the installation from the scratch again. I executed the following commands (without any error), but the mshop_customer_list_type have no records (others tables like products are ok).

Code: Select all

php artisan vendor:publish
 php artisan migrate
php artisan aimeos:setup --option=setup/default/demo:1
 php artisan aimeos:cache
 php artisan cache:clear
And when I run the command that you mentioned, the register is created at users table and it returns:

Code: Select all

[Aimeos\MShop\Exception]                            
  No item found for conditions: Array                 
  (                                                   
      [customer.lists.type.code] => default           
      [customer.lists.type.domain] => customer/group  
  )
How can I get around this?

Thank you for your patient, it is the first time I do it alone.

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

Re: Links at views going to root

Post by aimeos » 18 Sep 2016, 08:39

You've said the "mshop_customer_list_type" table is empty. What about the "users_list_type"?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

daniel.groppo
Posts: 6
Joined: 17 Sep 2016, 07:22

Re: Links at views going to root

Post by daniel.groppo » 18 Sep 2016, 19:18

Yes, there are 5 registers in users_list_types.

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

Re: Links at views going to root

Post by aimeos » 19 Sep 2016, 08:03

There should be six. I guess, the one with domain='customer/group' is missing?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply