Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #178 - Temporary short documentation for the Laravel support #214

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions docs/content/getting-started/flavors.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Some specific explanation, illustrated with some code:

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


## Standalone

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

## Symfony

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

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

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

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

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.

## Laravel (experimental) {#laravel}

WIP
With the arrival of its version 2, *DbToolsBundle* opens up to the world of
*Laravel*.

As for *Symfony*, once installed:

- all commands are accessible via `artisan` (e.g. `php artisan db-tools:backup`),
- connection to your database(s) will be autoconfigured thanks to the
*Illuminate* database manager,
- anonymization can be configured through the package configuration file
`config/db-tools.php`.

For now, the documentation does not include any specific example or precision
related to *Laravel*. However, the configuration of *DbToolsBundle* in *Laravel*
is very similar to its configuration in a *Symfony* project which would use YAML
files for that purpose, except that you will use PHP files instead.

To get *DbToolsBundle* running:

- add it to your *Laravel* project with [composer](https://getcomposer.org):
```sh
composer require makinacorpus/db-tools-bundle
```
- only if you disabled the [package discovery][1] system, manually register the
*DbToolsBundle* service provider in your `bootstrap/providers.php` file:
```php
return [
// ...
MakinaCorpus\DbToolsBundle\Bridge\Laravel\DbToolsServiceProvider::class,
// ...
];
```
- run the command `php artisan vendor:publish` to initialize the configuration
file `config/db-tools.php`,
- configure the package to your needs.

The configuration file is quite well self-documented, you should not be
lost in configuring the package. If necessary, get help from the *Symfony*
documentation by following the YAML format examples.

Keep in mind that `db-tools:check` command is available to validate that
everything is operational.

[1]: https://laravel.com/docs/12.x/packages#package-discovery