@@ -18,17 +18,21 @@ with the phpVMS codebase.
18
18
19
19
To generate a module, run:
20
20
21
- ``` bash
21
+ ``` shell
22
22
php artisan module:make {ModuleName}
23
23
```
24
24
25
25
Which generates the basic structure in the ` /modules ` folder. After generating
26
26
the module, if you want to make it available on composer, edit the
27
27
` composer.json ` file, setting your ` VENDOR ` and author information.
28
28
29
- :::tip All of the examples below will be based on a module named ` Sample ` . To
29
+ ::: tip
30
+
31
+ All of the examples below will be based on a module named ` Sample ` . To
30
32
see the source for the module,
31
- [ check it out on GitHub] ( https://github.com/nabeelio/phpvms-module ) . :::
33
+ [ check it out on GitHub] ( https://github.com/nabeelio/phpvms-module ) .
34
+
35
+ :::
32
36
33
37
---
34
38
@@ -77,8 +81,6 @@ When a module is created, a directory structure like this is created:
77
81
78
82
### Automatic Installation
79
83
80
- :::note Still being written :::
81
-
82
84
To be able to publish to composer, add ` joshbrw/laravel-module-installer ` as a
83
85
dependency in your module's ` composer.json ` file, and then set the ` type ` in the
84
86
` composer.json ` file to ` laravel-module ` . Then a user can run
@@ -140,8 +142,12 @@ don't need to call a check or something in every method.
140
142
'middleware' => ['api.auth'] # for API routes, you can add this middlware to require API auth
141
143
```
142
144
143
- :::note Read more about
144
- [ Laravel Middleware] ( https://laravel.com/docs/9.x/middleware ) :::
145
+ ::: note
146
+
147
+ Read more about
148
+ [ Laravel Middleware] ( https://laravel.com/docs/9.x/middleware )
149
+
150
+ :::
145
151
146
152
---
147
153
@@ -257,11 +263,15 @@ Laravel includes a way to create and update tables, called
257
263
programmatically define your tables, and let the framework worry about the exact
258
264
syntax to use. The advantage to this abstraction is being.
259
265
260
- ! You should _ not_ be using raw SQL
266
+ ::: warning
267
+
268
+ You should _ not_ be using raw SQL
269
+
270
+ :::
261
271
262
272
There is an ` artisan ` helper to generate migrations:
263
273
264
- ``` bash
274
+ ``` shell
265
275
php artisan module:make-migration create_sample_table ModuleName
266
276
```
267
277
@@ -274,13 +284,22 @@ straight-forward, without having to run any SQL manually.
274
284
The ` app/Database/migrations ` directory has the core migrations and is a good
275
285
reference on field types, especially if you're looking to add relationships.
276
286
277
- !!! Design your tables well - follow the guidelines set by Laravel, and you'll
287
+ ::: note
288
+
289
+ Design your tables well - follow the guidelines set by Laravel, and you'll
278
290
have a much better time.
279
291
280
- !!!! Add new migration files when you have to modify a table, etc, after you've
292
+ :::
293
+
294
+
295
+ ::: note
296
+
297
+ Add new migration files when you have to modify a table, etc, after you've
281
298
released it into the wild. The migrations that are run are kept track of, so if
282
299
it's seen that it's already run the file, it won't run it again.
283
300
301
+ :::
302
+
284
303
### Seeding Data
285
304
286
305
I've added a few extra features, including adding seed data, including adding
0 commit comments