0

After merging branch, I am facing this error.

lluminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required 'D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php' (include_path='.;C:\php\pear')

All composer update/installs failed with same error below.

Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover

In ServiceProvider.php line 59:

lluminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required 'D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php' (include_path='.;C:\php\pear')

Line No 59 in ServiceProvider.php

/**
 * Merge the given configuration with the existing configuration.
 *
 * @param  string  $path
 * @param  string  $key
 * @return void
 */
protected function mergeConfigFrom($path, $key)
{
    $config = $this->app['config']->get($key, []);

    $this->app['config']->set($key, array_merge(require $path, $config));
}
Community
  • 1
  • 1
Shivam Pandya
  • 1,061
  • 3
  • 29
  • 64
  • See this: https://laracasts.com/discuss/channels/general-discussion/how-does-mergeconfigfrom-work May be it helps you! – Hiren Gohel Feb 02 '18 at 05:16

3 Answers3

0

Try composer autoload files.

composer dump-autoload

  • Not working, same error : Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover In ServiceProvider.php line 59: lluminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required 'D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php' (include_path='.;C:\php\pear') – Shivam Pandya Feb 02 '18 at 05:05
  • try to composer self-update after that you can try above command – Sathishkumar Manoharan Feb 02 '18 at 05:15
0

Edit:

I noticed both slash styles are being used in this path:

D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php

I would check if that file even exists first.

Original

It's failing to merge the updated config file for voyager into your existing config file. Compare these two files:

D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php

And the one in your project:

D:\project_folder_path\config\voyager-hooks.php

It is likely you have lines that are two similar for the merge to know what to do with.

  • There is no "voyager-hooks.php" in D:\project_folder_path\config\ and no publishable folder under "D:\project_folder_path\vendor\larapack\voyager-hooks/" – Shivam Pandya Feb 02 '18 at 05:54
  • `'D:\project_folder_path\vendor\larapack\voyager-hooks/publishable/config/voyager-hooks.php' ` This has to be the problem. It's using both windows and unix style directory separators. Is there a custom service provider in your app that is doing this merge? –  Feb 02 '18 at 05:56
0

Those files was deleted, if you are using git, you can restore that folder. check with git status, then restore with git restore or git checkout. But i dont know reason why are deleting.

TonyInuma
  • 111
  • 1
  • 3