Laravel 5.4 resource route is not working inside grouped routes

56
July 28, 2018, at 04:40 AM
The show method does not hit when I try to access

localhost/rafiran/{some_valid_id}

The index method is working fine.

Route::group(['middleware'=>'role:admin|contributor|moderator','prefix'=>'rafiran'],function(){
            Route::resource('/','RafiranController');
});

php artisan route:list shows

|        | GET|HEAD  | rafiran                                | index                   | App\Http\Controllers\RafiranController@index
|        | POST      | rafiran                                | store                   | App\Http\Controllers\RafiranController@store
|        | GET|HEAD  | rafiran/create                         | create                  | App\Http\Controllers\RafiranController@create
|        | PUT|PATCH | rafiran/{}                             | update                  | App\Http\Controllers\RafiranController@update
|        | GET|HEAD  | rafiran/{}                             | show                    | App\Http\Controllers\RafiranController@show
|        | DELETE    | rafiran/{}                             | destroy                 | App\Http\Controllers\RafiranController@destroy
|        | GET|HEAD  | rafiran/{}/edit                        | edit                    | App\Http\Controllers\RafiranController@edit

However, when I do it without prefix it works fine!

Route::group(['middleware'=>'role:admin|contributor|moderator'],function(){
        Route::resource('rafiran','RafiranController');        
});

The error shown is

NotFoundHttpException

in RouteCollection.php line 179
at RouteCollection->match(object(Request))
in Router.php line 546

I tried to debug the line at Illuminate\Routing\RouteCollection line 164
method $this->matchAgainstRoutes($routes, $request); is returning null for show method described at RafiranController.

READ ALSO
PHP-DI: create vs. autowire vs. get. Or how to correctly map an interface to an implementation provided by a definition

PHP-DI: create vs. autowire vs. get. Or how to correctly map an interface to an implementation provided by a definition

For my PHP-DI container in a web MVC I prepared the following definition for a router:

75
Using Ajax and JQuery to call PHP Script

Using Ajax and JQuery to call PHP Script

I am currently trying to send form data to a PHPMyAdmin MySQL serverWithout Ajax, everything works on a web server, but the problem is that the webpage is redirected

49
Writing php code based on c# code or curl

Writing php code based on c# code or curl

I created windows application on c# where I load image in piture box, then create memory stream, then ready bytes of the image, then send it as PUT to web service [code]

72
Display text stored in a database with markup correctly in HTML

Display text stored in a database with markup correctly in HTML

I'm trying to allow notes to be stored in a database that, when retrieved, are displayed with stylingFor example, the following text is stored in a notes column in the database:

48