From eab1cbd39ab0200e9169aafe9ee6dac42c15c97e Mon Sep 17 00:00:00 2001 From: Michael Dyrynda Date: Mon, 9 Apr 2018 23:34:29 +0930 Subject: [PATCH] update readme to document provider and configuration behaviour --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c468c2..0d94a10 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ In order to create a new Vagabond project, you can use [Composer](https://getcom composer create-project --prefer-dist dyrynda/vagabond wanderer ``` -Once installed, you will have access to the `nomad` application, a default configuration to work with an sqlite database, and a `MigrationServiceProvider` that will be automatically loaded, should you choose to use your Vagabond project to share your migrations with other Laravel applications. +Once installed, you will have access to the `nomad` application, a default configuration to work with an sqlite database, and a `VagabondServiceProvider`. You can extend from this service provider to handle automatically loading configuration for each of your connections. All you need to do is define a protected property - `$connectionName` - on the child provider, that corresponds to the connection you are configuring. ## Usage -Out of the box, Vagabond is configured to use a MySQL database in `config/database.php`. As with Laravel, you can [configure your connections](https://laravel.com/docs/5.5/database#configuration) and database drivers of choice, as well as keeping credentials safe in your `.env` file. +Out of the box, Vagabond is configured to use a MySQL database in `config/database.php`. As with Laravel, you can [configure your connections](https://laravel.com/docs/5.6/database#configuration) and database drivers of choice, as well as keeping credentials safe in your `.env` file. To create a migration, use the `make:migration` Nomad command. @@ -46,9 +46,9 @@ For further information on the available commands and their functions, be sure t ## Using Vagabond in Laravel applications -As Vagabond makes use of Laravel's package auto-discovery, you can easily include it in any application that access the database which it manages, by requiring the repository as a package. +You can use Vagabond in your Laravel applications by defining and including service providers centrally in one repository, and include them in any applications that need them. -In doing so, your Laravel application will be able to access the migrations, making it very simple to use them in your test environment, whilst still managing your production database in a standalone fashion. This also means that your database could be separately versioned and even managed by database administrators independently of your development process. +In doing so, your Laravel application will be able to access the migrations and database configuration, making it very simple to use them in your test environment, whilst still managing your production database in a standalone fashion. This also means that your database could be separately versioned and even managed by database administrators independently of your development process. **Note:** Be sure not to call the `nomad` console application within your Laravel app as it will not run correctly. When ready, you can use the usual Artisan migrate tools. @@ -62,6 +62,8 @@ Special thanks to [Nuno Maduro](https://twitter.com/enunomaduro) for the work he ## Support +You can learn more about this project and how it is used [here](https://dyrynda.com.au/blog/sharing-databases-between-laravel-applications). + If you are having general issues with this package, feel free to contact me on [Twitter](https://twitter.com/michaeldyrynda). If you believe you have found an issue, please report it using the [GitHub issue tracker](https://github.com/michaeldyrynda/vagabond/issues), or better yet, fork the repository and submit a pull request.