Skip to content

Commit 62b8e40

Browse files
author
Sandip Patel
committed
key change for modules
1 parent 8b18746 commit 62b8e40

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
### Laravel Modular
2+
3+
If you are seeking for laravel feature where you can use modules in your application
4+
which can be easily turn on/off then this is a good package for you.
5+
6+
### How to Install my package?
7+
8+
`composer require "phpcodebooster/laravel"` <br>
9+
`php artisan vendor:publish`
10+
11+
### How to use this package?
12+
13+
Let us create an Admin module that can be turned on/off from your
14+
laravel project
15+
16+
- create a directory called Admin in "App/Modules" folder ex. app/Modules/Admin
17+
- open config/modules.php file and add following line:
18+
19+
`
20+
return [
21+
'admin' => 'Admin Module'
22+
];
23+
`
24+
That is it your module is now enabled for your project. Following will be the ideal
25+
structure for your admin module
26+
27+
App
28+
|-- Admin
29+
|-- Controllers
30+
|-- Views
31+
|-- config.php
32+
|-- routes.php
33+
34+
To access your module configuration use lowercase module name
35+
Ex.
36+
37+
`$admin_config = config('admin');`
38+
39+
To use admin views in your controller use:
40+
41+
`return view('admin::index'); `
42+
43+
or
44+
45+
`return view('admin::folder.file'); `

0 commit comments

Comments
 (0)