JeffreyWay / Laravel-4-Generators

Rapidly speed up your Laravel workflow with generators
https://packagist.org/packages/way/generators
MIT License
27 stars 9 forks source link

Handling on production server #464

Closed KuenzelIT closed 8 years ago

KuenzelIT commented 8 years ago

Hey,

since I require the generators only on my dev machine, they are missing on the production server. So I need to remove the Service Provider in Laravels app.php .

Is there some nice way to handle this besides removing that line from the config? (like some service provider dev or something else?)

Thank you!

chrisforrence commented 8 years ago

You can!

  1. Populate the environments in your bootstrap/start.php, such as a "local" entry.

    $env = $app->detectEnvironment(array(
    
       'local' => array('little-mac.local', 'lithium.local'), // replace with your own entries
    
    ));
  2. Within app/config/local/app.php, add the following entry:

    'providers' => append_config([
       'Way\Generators\GeneratorsServiceProvider',
    ]),

This will allow the artisan commands to only be available to environments defined in your bootstrap/start.php file.

KuenzelIT commented 8 years ago

Thank you!