Routing Configuration File
The routing configuration file for plugins is located at plugin/plugin_name/config/route.php
.
Default Routes
The URL address paths for application plugins all start with /app
. For example, the URL address for plugin\foo\app\controller\UserController
is http://127.0.0.1:8787/app/foo/user
.
Disable Default Routes
If you want to disable the default route for a specific application plugin, you can set it in the routing configuration like this:
Route::disableDefaultRoute('foo');
Handle 404 Callback
If you want to set a fallback for a specific application plugin, you need to pass the plugin name as the second parameter. For example:
Route::fallback(function(){
return redirect('/');
}, 'foo');