As applications are always changing with every single pull/merge request that is merged into the main branch, if a team has
several developers, there could be a chance that the local applications for other developers may not reflect the application
state of the latest master
version.
This package is designed for teams using Laravel and other dependencies such as Node modules - and the aim is to inform developers about the state of their local application and whether they need to take actions that will help ensure the application state reflects the latest merged version of an application.
- Why use this package?
- Installation
- Usage
- Code Style
- Testing
- Note about Git Hooks
- Contributing
- Credits
- License
Here's a list of what could change on every merge:
composer.lock
has been modifed, acomposer install
will have to take place.composer.json
has been modified, acomposer dumpauto
might have to take place.package.json
ORnpm-skrinkwrap.json
ORyarn.lock
file has been modified, an appropriate command to make sure the frontend dependencies are available.- Files in
resources/assets
could have been modified, meaning a command likegulp
might have to be run. - Database migrations could have been added.
This could help with situations like "My tests pass on CI, but not locally - what can I do?". The first step will probably be making sure the application and all of its dependencies are in sync with the master
application version.
It is recommended to use this during local development ONLY and this package's service provider will have to be registered manually.
Add the laravel-informant package to your composer.json
file.
{
"require": {
"mcampbell508/laravel-informant": "1.0.*"
}
}
Or via the command line in the root of your Laravel installation.
$ composer require "mcampbell508/laravel-informant:1.0*"
- If you would like to limit the environment
- Within the
register
method ofapp/Providers/AppServiceProvider.php
or where prefered...
- Within the
$informantEnvironments = config('informant.service_providers.limit_environments');
if (empty($informantEnvironments) || in_array($this->app->environment(), $informantEnvironments)) {
$this->app->register(\MattCampbell\Laravel\InformantServiceProvider::class);
}
default values for
config('informant.service_providers.limit_environments')
are ['local', 'testing']
- Or if you do not want to limit the environment:
config/app.php
service providers array...
\MattCampbell\Laravel\InformantServiceProvider::class,
- Publish the config file:
php artisan vendor:publish --provider="MattCampbell\Laravel\InformantServiceProvider"
php artisan informant:status
This project follows the following code style guidelines:
- PSR-2 & PSR-4 coding style guidelines.
- Some chosen PHP-CS-Fixer rules.
$ php vendor/bin/php-cs-fixer fix
$ php vendor/bin/phpunit
There are also tools such as Git Hooks which could be used to make sure these things are tackled at source like when doing things like a git rebase
and it is recommended to use these tools but this is outside the scope of this package.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.