Support the ongoing development of Laravel.io →
Configuration IOC Laravel.io

I'm wondering what is the difference between:

Route::post('insert/{slug}/{page_number}/{person_type_id}/{user_id}', function($slug) { return Response::json( [ 'success' => false, 'slug' => $slug ]); });

and this: Route::post('{slug}/users/page/{page_number}/insert-ben/{person_type_id}/user/{user_id}', 'PersonsController@insertBen');

The first one works. The latter used to work but it's no longer working now. I tried stepping through the code and the latter ends up going to the UsersController@login rather than to PersonsConroller@insertBen. So odd. This was working about a month ago. I'm trying to see what I changed with my version control but it's so strange that it's not working all of a sudden.

My posts are working fine as I can login and the UsersController@doLogin is being called.

I even tested with this call: Route::post('{slug}/users/page/{page_number}/insert-ben/{person_type_id}/user/{user_id}', 'UsersController@insertTest');

/controllers/UsersController.php

public function insertTest($slug)
{
    if ( Request::ajax() ) {
        return Response::json( [

            'success' => false,
            'slug'      => $slug

        ] );
    }

}

But the UsersController@insertTest doesn't work either. My PersonsController is working fine as I can update using this controller. So what could be the problem? Anyone encounter something similar?

Much thanks and God bless<><, Victor

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

vkimura vkimura Joined 5 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.