File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ You can publish and run the migrations with:
27
27
28
28
``` bash
29
29
php artisan vendor:publish --tag=" laravel-db-doc-migrations"
30
- php artisan migrate
31
30
```
32
31
33
32
You can publish the config file with:
@@ -36,13 +35,6 @@ You can publish the config file with:
36
35
php artisan vendor:publish --tag=" laravel-db-doc-config"
37
36
```
38
37
39
- This is the contents of the published config file:
40
-
41
- ``` php
42
- return [
43
- ];
44
- ```
45
-
46
38
Optionally, you can publish the views using
47
39
48
40
``` bash
@@ -51,9 +43,29 @@ php artisan vendor:publish --tag="laravel-db-doc-views"
51
43
52
44
## Usage
53
45
46
+ To generate database schema in Markdown format:
47
+
48
+ ``` php
49
+ php artisan db:schema
50
+ ```
51
+
52
+ To generate database schema in JSON format:
53
+
54
54
``` php
55
- $laravelDbDoc = new Bekwoh\LaravelDbDoc();
56
- echo $laravelDbDoc->echoPhrase('Hello, Bekwoh!');
55
+ php artisan db:schema --format=json
56
+ ```
57
+
58
+ To generate database schema for specific connection:
59
+
60
+ ``` php
61
+ php artisan db:schema --database=sqlite
62
+ ```
63
+
64
+ To generate output to specific storage, add in ` .env ` :
65
+
66
+ ``` bash
67
+ LARAVEL_DB_DOC_MARKDOWN_DISK=s3
68
+ LARAVEL_DB_DOC_JSON_DISK=s3
57
69
```
58
70
59
71
## Testing
Original file line number Diff line number Diff line change 10
10
'presentations ' => [
11
11
'markdown ' => [
12
12
'class ' => Markdown::class,
13
- 'disk ' => ' local ' ,
13
+ 'disk ' => env ( ' LARAVEL_DB_DOC_MARKDOWN_DISK ' , ' local ') ,
14
14
'view ' => 'db-doc::markdown ' ,
15
15
],
16
16
'json ' => [
17
17
'class ' => Json::class,
18
- 'disk ' => ' local ' ,
18
+ 'disk ' => env ( ' LARAVEL_DB_DOC_JSON_DISK ' , ' local ') ,
19
19
'view ' => null ,
20
20
],
21
21
],
You can’t perform that action at this time.
0 commit comments