Skip to content

Commit 37d1869

Browse files
committed
Make presenter disk configurable
1 parent f764b3d commit 37d1869

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ You can publish and run the migrations with:
2727

2828
```bash
2929
php artisan vendor:publish --tag="laravel-db-doc-migrations"
30-
php artisan migrate
3130
```
3231

3332
You can publish the config file with:
@@ -36,13 +35,6 @@ You can publish the config file with:
3635
php artisan vendor:publish --tag="laravel-db-doc-config"
3736
```
3837

39-
This is the contents of the published config file:
40-
41-
```php
42-
return [
43-
];
44-
```
45-
4638
Optionally, you can publish the views using
4739

4840
```bash
@@ -51,9 +43,29 @@ php artisan vendor:publish --tag="laravel-db-doc-views"
5143

5244
## Usage
5345

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+
5454
```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
5769
```
5870

5971
## Testing

config/db-doc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
'presentations' => [
1111
'markdown' => [
1212
'class' => Markdown::class,
13-
'disk' => 'local',
13+
'disk' => env('LARAVEL_DB_DOC_MARKDOWN_DISK', 'local'),
1414
'view' => 'db-doc::markdown',
1515
],
1616
'json' => [
1717
'class' => Json::class,
18-
'disk' => 'local',
18+
'disk' => env('LARAVEL_DB_DOC_JSON_DISK', 'local'),
1919
'view' => null,
2020
],
2121
],

0 commit comments

Comments
 (0)