Publishing a Package's Configuration to Your Application

Problem

You want to copy a third party's configuration to your application.

Solution

Use the php artisan config:publish command.

$ php artisan config:publish cool-package

This creates all needed configuration files in your app/config/packages/cool-package directory.

Often, this is a single file named config.php.

Discussion

For non-Laravel packages you may need to specify the path.

$ php artisan config:publish cool-package --path=/some/config/dir
comments powered by Disqus