Voyager create multiple routes for same table
Yes, it's possible. Inside vendor\tcg\voyager\routes\voyager.php after event(new RoutingAdmin()); add another route. For same table you need to create a new controller also resources. You can do this by copying vendor\tcg\voyager\src\Http\Controllers\VoyagerBaseController.php to new controller TableNameNewController and for resource copy vendor\tcg\voyager\resources\views\bread blade files inside resources\views\vendor\voyager(Folder Name). For New Controller:
- Make sure to change the namespace App\Http\Controllers and class name TableNameNewController after duplicate the VoyagerBaseController.
- Change the slug to $slug = '(Table Name)';
- Also $view = 'voyager::(Folder Name).browse';
For Resources:
- Create folder called vendor inside resources\views
- Inside vendor create another folder called voyager
- After that copy vendor\tcg\voyager\resources\views\bread folder inside resources\views\vendor\voyager and rename (Folder Name)
For Route:
- Inside vendor\tcg\voyager\routes\voyager.php after event(new RoutingAdmin()); add new routes. For example: Route::get('tableNameNew', ['uses' =>'App\Http\Controllers\TableNameNewController@index', 'as' => 'index']);
*If you add new function in the controller you need to make changes in the blade files or you can add action buttons. For more watch https://voyager.devdojo.com/academy/