如何在laravel上自定义Route :: resource?

If my routes like this :

Route::prefix('member')->middleware('auth')->group(function(){
    Route::prefix('purchase')->group(function(){
        Route::get('order', 'Member\PurchaseController@order')->name('member.purchase.order');
        Route::get('transaction', 'Member\PurchaseController@transaction')->name('member.purchase.transaction');
    });
    Route::resource('purchase', 'Member\PurchaseController');
});

If I call : http://my-app.test/member/purchase/1, it works. No error

But I change my routes like this :

 Route::prefix('member')->middleware('auth')->group(function(){
    Route::prefix('purchase')->group(function(){
        Route::get('order', 'Member\PurchaseController@order')->name('member.purchase.order');
        Route::get('transaction', 'Member\PurchaseController@transaction')->name('member.purchase.transaction');
        Route::resource('/', 'Member\PurchaseController');
    });
 });

If I call : http://my-app.test/member/purchase/1, there exist error like this :

Sorry, the page you are looking for could not be found.

I'm using Laravel 5.6. How can I solve this error?

Please try this :

 Route::prefix('member')->middleware('auth')->group(function(){
  Route::prefix('purchase')->group(function(){
  Route::resource('/', 'Member\PurchaseController');  
  Route::get('order', 'Member\PurchaseController@order')->name('member.purchase.order');
  Route::get('transaction', 'Member\PurchaseController@transaction')->name('member.purchase.transaction');   
  });
});

php artisan api:route

Run this command in your root folder. It will list you all the routes you have defined . Check which route is displaying with the use of resource.