Skip to content

Commit 035ce86

Browse files
committed
Update README and fix access
1 parent 7e1d203 commit 035ce86

File tree

2 files changed

+9
-28
lines changed

2 files changed

+9
-28
lines changed

README.md

+7-26
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,15 @@ protected $subscribe = [
123123
];
124124
```
125125

126+
#### Registering routes:
127+
All modules will by default try to load all route files in the `Routes` folder.
128+
Any of the following files will be auto loaded:
129+
130+
`routes.php` `api.php` `web.php`
131+
126132
## Requirements
127133

128-
This package requires at least Laravel 5.8 or higher, PHP 7.2 or higher
134+
This package requires at least Laravel 6 or higher, PHP 7.2 or higher
129135

130136
## Installation
131137

@@ -143,31 +149,6 @@ Register the namespace: `"Modules\\": "app/Modules"` in `composer.json` like:
143149
...
144150
```
145151

146-
In the following files: `web.php`, `api.php`, `channels.php`, `console.php` insert respectively:
147-
``` php
148-
Route::modules('web');
149-
Route::modules('api');
150-
Route::modules('channels');
151-
Route::modules('console');
152-
```
153-
154-
Routes will then be searched in the `Routes` folder of every module, but don't necessarily have to exist:
155-
156-
```$xslt
157-
├──MyModule
158-
├──Routes
159-
├──web.php (optional)
160-
├──api.php (optional)
161-
├──channels.php (optional)
162-
├──console.php (optional)
163-
```
164-
165-
There is also the option to insert:
166-
``` php
167-
Route::modules();
168-
```
169-
Routes will then be searched in `routes.php` at the root of the module
170-
171152
## Authors
172153

173154
* **Aron Rotteveel**

src/Module.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
*/
2222
abstract class Module extends ServiceProvider implements ModuleContract
2323
{
24-
private const ROUTE_FILE_TYPES = [
25-
'routes', 'web', 'api', 'channels', 'console',
24+
protected const ROUTE_FILE_TYPES = [
25+
'routes', 'web', 'api',
2626
];
2727

2828
/** @var array */

0 commit comments

Comments
 (0)