Skip to content

Commit b3a78cd

Browse files
authored
Issue #178 - Add a temporary short documentation for the Laravel support
1 parent 7d6cdb9 commit b3a78cd

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

docs/content/getting-started/flavors.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Some specific explanation, illustrated with some code:
2424

2525
Or juste a specific <span db-tools-flavor="standalone-symfony-docker-laravel">`command line`</span> in a paragraph.
2626

27-
2827
## Standalone
2928

3029
First and foremost, *DbToolsBundle* is a PHP library. It can easily be used on any project managed
@@ -38,7 +37,7 @@ to find the database(s) you want to manage.
3837

3938
## Symfony
4039

41-
*DbToolsBundle* was, in its first version, a tools for *Symfony* developers only. The library can still
40+
*DbToolsBundle* was, in its first version, a tool for *Symfony* developers only. The library can still
4241
be fully integrated into any Symfony project via its dedicated bridge.
4342

4443
Right after you installed the bundle, and with zero configuration:
@@ -52,10 +51,52 @@ Right after you installed the bundle, and with zero configuration:
5251

5352
*DbToolsBundle* can be used in any CI/CD using its [*Docker* image](https://hub.docker.com/r/makinacorpus/dbtoolsbundle).
5453

55-
This image is based on [FrankenPHP](https://frankenphp.dev/docs/docker/). Every *DbtoolsBundle* commands can be run with `docker container run` utility.
54+
This image is based on [FrankenPHP](https://frankenphp.dev/docs/docker/). Every *DbToolsBundle* commands can be run with `docker container run` utility.
5655

5756
All configuration can be set up mounting a config file (see [installation section](/getting-started/installation) for an example). This config file uses the exact same syntax as for the standalone flavor.
5857

5958
## Laravel (experimental) {#laravel}
6059

61-
WIP
60+
With the arrival of its version 2, *DbToolsBundle* opens up to the world of
61+
*Laravel*.
62+
63+
As for *Symfony*, once installed:
64+
65+
- all commands are accessible via `artisan` (e.g. `php artisan db-tools:backup`),
66+
- connection to your database(s) will be autoconfigured thanks to the
67+
*Illuminate* database manager,
68+
- anonymization can be configured through the package configuration file
69+
`config/db-tools.php`.
70+
71+
For now, the documentation does not include any specific example or precision
72+
related to *Laravel*. However, the configuration of *DbToolsBundle* in *Laravel*
73+
is very similar to its configuration in a *Symfony* project which would use YAML
74+
files for that purpose, except that you will use PHP files instead.
75+
76+
To get *DbToolsBundle* running:
77+
78+
- add it to your *Laravel* project with [composer](https://getcomposer.org):
79+
```sh
80+
composer require makinacorpus/db-tools-bundle
81+
```
82+
- only if you disabled the [package discovery][1] system, manually register the
83+
*DbToolsBundle* service provider in your `bootstrap/providers.php` file:
84+
```php
85+
return [
86+
// ...
87+
MakinaCorpus\DbToolsBundle\Bridge\Laravel\DbToolsServiceProvider::class,
88+
// ...
89+
];
90+
```
91+
- run the command `php artisan vendor:publish` to initialize the configuration
92+
file `config/db-tools.php`,
93+
- configure the package to your needs.
94+
95+
The configuration file is quite well self-documented, you should not be
96+
lost in configuring the package. If necessary, get help from the *Symfony*
97+
documentation by following the YAML format examples.
98+
99+
Keep in mind that `db-tools:check` command is available to validate that
100+
everything is operational.
101+
102+
[1]: https://laravel.com/docs/12.x/packages#package-discovery

0 commit comments

Comments
 (0)