All Projects → percymamedy → Laravel Dev Booter

percymamedy / Laravel Dev Booter

Licence: mit
🚧 Boost your Laravel app by registering Prod services only on Prod.

Labels

Projects that are alternatives of or similar to Laravel Dev Booter

Pro
ECStore Pro - Laravel 微信网店微服务框架
Stars: ✭ 14 (-50%)
Mutual labels:  laravel
Easyhttp
A Laravel HTTP-client to make HTTP request easier and log requests and responses
Stars: ✭ 20 (-28.57%)
Mutual labels:  laravel
Dt54
Laravel 5.4 DataTables Demo Application (WIP)
Stars: ✭ 27 (-3.57%)
Mutual labels:  laravel
Billing
A general purpose interface to Stripe that's optimized for Laravel 5 SaaS applications.
Stars: ✭ 14 (-50%)
Mutual labels:  laravel
Laravel Scout Elastic
Elastic Driver for Laravel Scout
Stars: ✭ 886 (+3064.29%)
Mutual labels:  laravel
Laravel Scrum Dev Paas
Laravel后端服务,提供团队协作管理平台的后端业务逻辑
Stars: ✭ 21 (-25%)
Mutual labels:  laravel
Vue Model
Model component for Vue.js
Stars: ✭ 877 (+3032.14%)
Mutual labels:  laravel
Larawiz
Larawiz is a easy project scaffolder for Laravel
Stars: ✭ 28 (+0%)
Mutual labels:  laravel
Laravel Tabler
Laravel Package for integrating Tabler template and this package is Laravel Mix friendly.
Stars: ✭ 20 (-28.57%)
Mutual labels:  laravel
Doorman
Limit access to your Laravel applications by using invite codes
Stars: ✭ 913 (+3160.71%)
Mutual labels:  laravel
Freshdesk Laravel
Freshdesk Service Provider for Laravel 5 and Lumen
Stars: ✭ 14 (-50%)
Mutual labels:  laravel
Chatify
A Laravel package that allows you to add a complete user messaging system into your new/existing Laravel application.
Stars: ✭ 885 (+3060.71%)
Mutual labels:  laravel
Pusher Chatkit Laravel
Laravel wrapper for the Chatkit PHP SDK. ChatKit is shutting down 😕 - https://blog.pusher.com/narrowing-our-product-focus
Stars: ✭ 21 (-25%)
Mutual labels:  laravel
Blazar
Pre-Render Pages on the Fly in Laravel
Stars: ✭ 14 (-50%)
Mutual labels:  laravel
Laravel Nuxt
A Laravel-Nuxt starter kit.
Stars: ✭ 943 (+3267.86%)
Mutual labels:  laravel
Vat Calculator
Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be. Integrates with Laravel and Cashier — or in a standalone PHP application.
Stars: ✭ 876 (+3028.57%)
Mutual labels:  laravel
Scheduled Tweets App
A Laravel app to schedule tweets
Stars: ✭ 21 (-25%)
Mutual labels:  laravel
Laravel Sftp
SFTP filesystem service provider for Laravel
Stars: ✭ 28 (+0%)
Mutual labels:  laravel
Eloquent Driver
A package that allows you to store Statamic entries in a database.
Stars: ✭ 28 (+0%)
Mutual labels:  laravel
Orderable
My very first Laravel package
Stars: ✭ 21 (-25%)
Mutual labels:  laravel

Laravel dev booter

Latest Stable Version Latest Unstable Version Build Status StyleCI License Total Downloads

Introduction

During development of a Laravel App; some Service Providers are very helpful. These services helps us with debugging and coding. But registering these providers on production is usually not a good idea. They can slow down our App or even expose sensitive information.

Laravel Dev Booter helps end this problem. The package consists of a single Service Provider. This provider will exclude unwanted providers from your production environment.

License

Laravel Dev Booter is open-sourced software licensed under the MIT license

Version Compatibility

Laravel DevBooter
5.x 0.2.x
6.x 1.0.x
7.x 2.0.x

Installation

Install Laravel Dev Booter as you would with any other dependency managed by Composer:

$ composer require percymamedy/laravel-dev-booter

Configuration

If you are using Laravel >= 5.5, you can skip service registration and aliases registration thanks to Laravel auto package discovery feature.

After installing Laravel Dev Booter all you need is to register the PercyMamedy\LaravelDevBooter\ServiceProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    PercyMamedy\LaravelDevBooter\ServiceProvider::class,
],

Usage

First use the vendor:publish command to copy the configuration file to your application:

$ php artisan vendor:publish --provider="PercyMamedy\LaravelDevBooter\ServiceProvider" --tag="config"

This will create the file config/dev-booter.php.

Defining your development environments

In the file config/dev-booter.php you will find the dev_environments section. Use this section to define your app's development environments:

'dev_environments' => [
    'local',
    'dev',
    'testing'
],

These are the only environments where Dev Booter will act; and try to register any Service providers.

Development Service providers locations

The next section in the config/dev-booter.php file is the dev_providers_config_keys. The array contains an entry for each of your development environments specified above. Feel free to add and edit this section.

'dev_providers_config_keys' => [
    'dev'     => ['app.dev_providers', 'app.local_providers'],
    'local'   => 'app.local_providers',
    'testing' => 'app.testing_providers',
]

The value for each of these entries can be an array or a string. The values represents the locations of a Service Provider array for each enviroment. You can even specify many locations for an environment, Dev Booter will take care of loading providers in each of these locations.

You may now define these Service Providers array in the config/app.php file as you would for any regular Service Provider:

'dev_providers' => [
    Foo\Bar\ServiceProvider::class,
],

'local_providers' => [
    Bar\Baz\ServiceProvider::class,
],

'testing_providers' => [
    Foo\Baz\ServiceProvider::class,
],

Development Aliases locations

The last section of the config/dev-booter.php file is the dev_aliases_config_keys. As with Service Providers, it works on the same principle.

You first specify the location of your aliases per environment:

'dev_aliases_config_keys' => [
    'dev'     => ['app.dev_aliases', 'app.local_aliases'],
    'local'   => 'app.local_aliases',
    'testing' => 'app.testing_aliases',
]

Then define these aliases array in the config/app.php file:

'dev_aliases' => [
    'Foo' => Foo\Bar\Facade::class,
],

'local_aliases' => [
    'Bar' => Bar\Baz\Facade::class,
],

'testing_aliases' => [
    'Baz' => Foo\Baz\Facade::class,
],

Going Further

In the above examples, providers and aliases array were define in config/app.php, but this does not have to be the case. You can define these array in any config files provided by Laravel or even create your own. Simply make sure you adjust your dev_providers_config_keys and dev_aliases_config_keys.

For example:

'dev_providers_config_keys' => [
    'dev' => ['app_dev.dev_providers', 'app_dev.local_providers'],
    // ...
]

Then in config/app_dev.php

'dev_providers' => [
    Foo\Bar\ServiceProvider::class,
],

'local_providers' => [
    Bar\Baz\ServiceProvider::class,
],

Credits

Big Thanks to all developers who worked hard to create something amazing!

Creator

Percy Mamedy

Twitter: @PercyMamedy
GitHub: percymamedy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].