Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
welcoMattic opened this issue Aug 17, 2016 · 3 comments
Closed

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

welcoMattic opened this issue Aug 17, 2016 · 3 comments

Comments

@welcoMattic
Copy link
Contributor

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
Copy link
Owner

asvae commented Aug 17, 2016

@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.

@asvae asvae added the question label Aug 17, 2016
@welcoMattic
Copy link
Contributor Author

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

@asvae
Copy link
Owner

asvae commented Aug 18, 2016

@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.

@asvae asvae closed this as completed Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants