Yes, "php artisan clear-compiled" command does it but it is only temporary solution.
I played with this a bit and figured out the fix.
If you open the file "/vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize" and scroll down to line ~200 you'll see the following:
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Expression/Expression.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/PathFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Shell/Shell.php',
Move the line ending in "FilterIterator.php" above "MultiplePcreFilterIterator.php" like so:
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Expression/Expression.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/PathFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php',
$basePath.'/vendor/symfony/finder/Symfony/Component/Finder/Shell/Shell.php',
Now you should be able to run php artisan optimize
and your app will work
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community