Hi,
I couldn't find a way to define default module to be loaded when entering my app.
In addition, is there any way to create hebrew routes for english-named modules?
Hello,
I'm not sure I understand the question. The module.json file has an order key which sets the order of loading the modules.
If your module is enabled, and order is set the lowest, it will get hit first.
About the routes, this isn't something this package can do. However, you can use something like https://github.com/mcamara/laravel-localization
@nWidart
I see what hes asking for... Lets assume he has a base module which would be the default module what hes saying is when the user accesses the website rather than it being yoursite.com/base it will just be yoursite.com/
Yes he could build all that above the module directory in the standard laravel structure however it is much nicer to do that in the modules. This way everything is kept nice and tidy.
Just define routes without module prefix and you will have it as _"default"_. I believe this is way too custom and should be done manually.
@unxp
I havent tested this package yet as I currently use caffeinated modules, but by removing the module prefix are you sure it will be seen as default... wont the standard laravel system take precedence?
There is no 'default' behaviour. Just create your routes to map your desired structure.
@mybigman it cannot. The behaviour is the same as if all modules routes would be placed in one routes.php file under app/Http. It would only conflict if you define some routes that override previously defined, but that should never be done. As @nWidart said, you are free to define your routes however you want. Run php artisan route:list to see all defined routes. This issue is not related to this package. You can read more about route prefixes here: HTTP Routing - Laravel - The PHP Framework For Web Artisans
Hey guys,
as it seems, this 'issue' is caused by my lack of experience with laravel.. :)
even so, I would like to show my solution for defining 'default' module, achieved with the great help of you guys :)
1) I removed the default route in app/http/routes.php
2) in my default moudle, I created a route group with Controller's namespace:
Route::group(['namespace' => 'Modules\Content\Http\Controllers'], function() {
Route::get('/', 'ContentController@index');
});
and that's it :)
apologize for creating 'wrong' issue
Awesome, good solution. 馃憤
No worries! 馃槃
Thanks @yNaxon. I was also searching for exactly samething.
Most helpful comment
Hey guys,
as it seems, this 'issue' is caused by my lack of experience with laravel.. :)
even so, I would like to show my solution for defining 'default' module, achieved with the great help of you guys :)
1) I removed the default route in app/http/routes.php
2) in my default moudle, I created a route group with Controller's namespace:
and that's it :)
apologize for creating 'wrong' issue