Modules should not define views, and boxes are expected to. Applications may or may not want to use views provided by boxes.
Registering of views can be enabled/disabled in the box config:
<?php return [ 'modules' => [ Vendor\MyModule\Providers\ModuleServiceProvider::class => [ 'views' => false ] ] ];
Naming View Folders
- Folder names must be all lowercase, eg:
- Folder names should be singular nouns, eg.
- In case the word consists of two parts, dash should be used, eg.:
Naming View Files
- File names must be all lowercase, eg.:
- In case a file is a partial (ie. doesn't extend a layout) the filename must begin with an underscore, eg:
- File names with multiple words should be separated with underscore, eg.:
- File names should follow this resource naming conventions:
show.blade.php(display a single resource)
index.blade.php(display a list of resources of a type)
create.blade.php(the create new entry page)
edit.blade.php(edit an existing entry page)
_form.blade.php(the shared form partial for both edit and create)
Namespace can also be set explicitely for view folder to be used as
<?php return [ 'modules' => [ Vendor\SuperBox\Providers\BoxServiceProvider::class => [ 'views' => [ 'namespace' => 'super' ] ] ] ];
and then use it as:
If not specified explicitely, default namespace is the module's folder name converted to snake case, eg.:
Vendor\SuperBox => 'super_box'
Next: Routes »