Laravel custom routes
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!
-
- Posts: 16
- Joined: 04 Sep 2017, 12:35
Laravel custom routes
I am trying to add a custom middleware in the /checkout route but seems like it doesn't want to work.
I followed the steps at https://aimeos.org/docs/Laravel/Custom_routes
So i added this piece of code to /app/Http/routes.php :
but nothing happens, i also put this line of code in /config/shop.php :
I run
and
every time but nothing changes.
if i do
i don't see the "checkout" URI listed.
I followed the steps at https://aimeos.org/docs/Laravel/Custom_routes
So i added this piece of code to /app/Http/routes.php :
Code: Select all
Route::match( array( 'GET', 'POST' ), 'checkout', array(
'as' => 'aimeos_shop_checkout',
'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction',
'middleware' => 'hasPaymentSet',
));
Code: Select all
'checkout' => ['middleware' => ['auth', 'hasMangopay']],
I run
Code: Select all
php artisan aimeos:cache
and
Code: Select all
php artisan cache:clear
if i do
Code: Select all
php artisan route:list
i don't see the "checkout" URI listed.
Re: Laravel custom routes
Can you try to put your route into "./routes/web.php"?
The location of the file changed between Laravel 5.2 and 5.3
The location of the file changed between Laravel 5.2 and 5.3
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 16
- Joined: 04 Sep 2017, 12:35
Re: Laravel custom routes
Gives me an error:
and if i try to remove this part:
it shows in the routes list as follow:
but i go to mywebsite/checkout nothing happens.
I think none of my routes in routes.php is working.
Code: Select all
[ReflectionException]
Class App\Http\Controllers\Aimeos\Shop\Controller\CheckoutController does not exist
Code: Select all
'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction',
Code: Select all
| | GET|POST|HEAD | checkout | aimeos_shop_checkout | Closure | web,hasPaymentSet |
I think none of my routes in routes.php is working.
Re: Laravel custom routes
Seem that Laravel uses a namespace relative to "App\Http\Controllers". Can you add a backslash in front of your controller@action: "\Aimeos\Shop\Controller\CheckoutController@indexAction"?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 16
- Joined: 04 Sep 2017, 12:35
Re: Laravel custom routes
Now it finds the controller but nothing happens if i go to mywebsite/checkout, this is the routes list:
Code: Select all
| | GET|POST|HEAD | checkout | aimeos_shop_checkout | \Aimeos\Shop\Controller\CheckoutController@indexAction | web,hasPaymentSet |
Re: Laravel custom routes
Might be a problem of your "hasPaymentSet" middleware
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star