Skip to content
New issue

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

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

Already on GitHub? # to your account

Install Error #62

Closed
laughingpain opened this issue Oct 4, 2017 · 2 comments
Closed

Install Error #62

laughingpain opened this issue Oct 4, 2017 · 2 comments
Labels

Comments

@laughingpain
Copy link

> @php artisan package:discover


  [LogicException]
  You must call one of in() or append() methods before iterating over a Finder.


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

fresh laravel 5.5.13 on WAMP with PHP 7.1

@kaidesu kaidesu added the bug label Oct 5, 2017
@mpenna
Copy link
Contributor

mpenna commented Nov 22, 2017

This also happens on a fresh Laravel 5.4.36

@mpenna
Copy link
Contributor

mpenna commented Nov 22, 2017

From what I could tell, it has to do with trying to traverse the themes folder during service registration when that folder hasn't yet been created. Changing the singleton registration to the following apparently fixes the issue:

$this->app->singleton('caffeinated.themes', function($app) {
    $themes = [];
    $items  = [];

    if ($path = config('themes.paths.absolute')) {
        if (file_exists($path) && is_dir($path)) {
            $themes = $this->app['files']->directories($path);
        }
    }

    foreach ($themes as $theme) {
        $manifest = new Manifest($theme.'/theme.json');
        $items[] = $manifest;
    }

    return new Theme($items);
});

@kaidesu kaidesu closed this as completed Dec 12, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants