asvae / laravel-api-tester

Test your routes without hassle
http://laravel-api-tester.asva.by/
MIT License
354 stars 52 forks source link

Is it possible to install api-tester only in dev? #19

Closed welcoMattic closed 8 years ago

welcoMattic commented 8 years ago

I don't want api-tester will be installed in production, even if it will not booted (due to APP_DEBUG value). I just want to install it on local environment, so it will be possible to install it with composer require asvae/laravel-api-tester --dev, and register the service provider through AppServiceProvider with:

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        if ($this->app->environment('local')) {
            $this->app->register(\Asvae\ApiTester\ServiceProvider::class);
        }
    }
asvae commented 8 years ago

@welcoMattic Yeah, I think that's possible. Not seeing much of point doing so, though. Config enabled does mostly the same thing.

BTW, api-tester won't let you cache the routes, if that's what worries you.

welcoMattic commented 8 years ago

It works fine, except that any change in published config file doesn't work.

asvae commented 8 years ago

@welcoMattic that's what I'm thinking on the matter.

You only require-dev package when it doesn't belong to your application. Meaning it won't unfold from laravel index.php but rather from some other place. So that's a good location for phpunit and not so good for laravel packages.

Highly opinionated, of course.