Laravel/Orchid - You must call one of in() or append() methods before iterating over a Finder

982 Views Asked by At

This is my composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "agatanga/flags": "^1.0",
        "beyondcode/laravel-websockets": "^1.12",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^9.19",
        "laravel/sanctum": "^3.0",
        "laravel/passport": "^10.1",
        "laravel/tinker": "^2.7",
        "livewire/livewire": "^2.8",
        "monarobase/country-list": "^3.2",
        "orchid/platform": "^13.1",
        "pusher/pusher-php-server": "^5.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

When I try to navigate to my admin url or Orchid I get this error:

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

Full details you can check here.

This error is driving me crazy. On my updated to version 9 laravel project it does not work. While it is working on fresh installed laravel. Any idea what can be the problem and how to solve it?

1

There are 1 best solutions below

0
On

I had the same problem. It helped me to downgrade to "orchid/platform": "^12.0". Also, take another look at the upgrade guide for orchid 12 and laravel 9.

Laravel: https://laravel.com/docs/9.x/upgrade

Orchid: https://orchid.software/en/docs/upgrade/#laravel-9x

P.S replace in config.platform

'icons' => [],

to

'icons' => [
    'orc' => \Orchid\IconPack\Path::getFolder(),
],

Weird, but this is what is causing me the error