Skip to content

Commit

Permalink
Update README and fix access
Browse files Browse the repository at this point in the history
  • Loading branch information
rdgout committed Sep 15, 2020
1 parent 7e1d203 commit 035ce86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
33 changes: 7 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,15 @@ protected $subscribe = [
];
```

#### Registering routes:
All modules will by default try to load all route files in the `Routes` folder.
Any of the following files will be auto loaded:

`routes.php` `api.php` `web.php`

## Requirements

This package requires at least Laravel 5.8 or higher, PHP 7.2 or higher
This package requires at least Laravel 6 or higher, PHP 7.2 or higher

## Installation

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

In the following files: `web.php`, `api.php`, `channels.php`, `console.php` insert respectively:
``` php
Route::modules('web');
Route::modules('api');
Route::modules('channels');
Route::modules('console');
```

Routes will then be searched in the `Routes` folder of every module, but don't necessarily have to exist:

```$xslt
├──MyModule
├──Routes
├──web.php (optional)
├──api.php (optional)
├──channels.php (optional)
├──console.php (optional)
```

There is also the option to insert:
``` php
Route::modules();
```
Routes will then be searched in `routes.php` at the root of the module

## Authors

* **Aron Rotteveel**
Expand Down
4 changes: 2 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
abstract class Module extends ServiceProvider implements ModuleContract
{
private const ROUTE_FILE_TYPES = [
'routes', 'web', 'api', 'channels', 'console',
protected const ROUTE_FILE_TYPES = [
'routes', 'web', 'api',
];

/** @var array */
Expand Down

0 comments on commit 035ce86

Please sign in to comment.