Recent Topics

Error on return value in ModelProxy::targetClass()



  • Hi everyone,

    I'm trying to setup Bagisto into an existing Laravel application, but I'm currently stuck on this error:
    Return value of Konekt\Concord\Proxies\ModelProxy::targetClass() must be of the type string, null returned

    The error originates in packages/Webkul/Category/src/Providers/CategoryServiceProvider.php in the following line:
    CategoryProxy::observe(CategoryObserver::class);

    It's a fresh installation, but I'm trying to implement it in an existing Laravel application (we're trying to get Bagisto working with our in-house CMS.). So far I've added the composer packages and added everything in config/app.php under the providers key.

    I searched but I couldn't find a solution to this. Can you guys help me out here?



  • Hi @Yorg,

    can you share the full implementation step by step so that I can investigate it further?



  • Hi @devansh-webkul, thanks for your help

    So these are the steps I took so far:

    1. Copy the packages folder
    2. Add the additional config files
    3. Add composer packages and install them (I've put my composer.json below)
    4. Copy the stubs folder
    5. Copy the views/themes folder

    I haven't ran my migrations yet, as I also get this error in my console.
    If I remove the packages from my config/app.php file, the error has disappeared but I have no bagisto artisanal command.

    If you need more info, just let me know!

    {
        "name": "pixeo/geni-lamp",
        "description": "Frontend rendering engine for Geni CMS.",
        "keywords": [
            "framework",
            "laravel"
        ],
        "license": "MIT",
        "type": "project",
        "require": {
            "php": ">=7.4",
            "ext-json": "*",
            "algolia/scout-extended": "^1.20",
            "aligent/bigcommerce-api-client": "1.4.0",
            "barryvdh/laravel-dompdf": "^0.9",
            "cohensive/embed": "^5.5",
            "cviebrock/eloquent-sluggable": "^8.0",
            "darryldecode/cart": "~4.0",
            "davejamesmiller/laravel-breadcrumbs": "^5.3",
            "doctrine/dbal": "^3.1",
            "gazsp/baum": "^2.0",
            "laravel/framework": "^8.58",
            "laravelium/sitemap": "^8.0",
            "mollie/laravel-mollie": "^2.0",
            "msurguy/honeypot": "^1.0",
            "myclabs/php-enum": "^1.5",
            "pixeo/laravel-robots": "^1.0.0",
            "pixeo/laravel-settings": "^3.0",
            "sentry/sentry-laravel": "^2.8",
            "simplesoftwareio/simple-qrcode": "^4.1",
            "spatie/laravel-html": "^2.30",
            "spatie/laravel-medialibrary": "^9.7",
            "spatie/laravel-menu": "^3.7",
            "spatie/laravel-missing-page-redirector": "^2.7",
            "spatie/laravel-schemaless-attributes": "^1.8",
            "spatie/laravel-translation-loader": "^2.7",
            "symfony/dom-crawler": "^5.3",
            "verschuur/laravel-robotstxt": "^3.0",
            "laravel/tinker": "^2.5",
            "laravel/ui": "^3.3",
            "fruitcake/laravel-cors": "^2.0",
            "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
            "algolia/algoliasearch-client-php": "^3.0",
            "astrotomic/laravel-translatable": "^11.0.0",
            "aws/aws-sdk-php": "^3.171",
            "babenkoivan/elastic-scout-driver": "^1.1",
            "bagistobrasil/bagisto-product-social-share": "^0.1.2",
            "enshrined/svg-sanitize": "^0.14.0",
            "fideloper/proxy": "^4.2",
            "flynsarmy/db-blade-compiler": "^5.5",
            "intervention/image": "^2.4",
            "intervention/imagecache": "^2.3",
            "kalnoy/nestedset": "^5.0",
            "khaled.alshamaa/ar-php": "^6.0.0",
            "konekt/concord": "^1.2",
            "laravel/legacy-factories": "^1.1",
            "laravel/scout": "^8.0",
            "laravel/socialite": "^5.0",
            "maatwebsite/excel": "^3.1.26",
            "paypal/paypal-checkout-sdk": "1.0.1",
            "prettus/l5-repository": "^2.6",
            "tymon/jwt-auth": "1.0.x-dev"
        },
        "require-dev": {
            "barryvdh/laravel-debugbar": "^3.6",
            "friendsofphp/php-cs-fixer": "^3.1",
            "itsgoingd/clockwork": "^3.1",
            "mockery/mockery": "^1.4.2",
            "nunomaduro/phpinsights": "^2.0",
            "phpunit/phpunit": "^8.5.8|^9.3.3",
            "fakerphp/faker": "^1.9.1",
            "facade/ignition": "^2.5",
            "nunomaduro/collision": "^5.0",
            "codeception/codeception": "^4.1",
            "codeception/module-asserts": "^1.1",
            "codeception/module-filesystem": "^1.0",
            "codeception/module-laravel5": "^1.0",
            "codeception/module-webdriver": "^1.0",
            "filp/whoops": "^2.0"
        },
        "replace": {
            "bagisto/laravel-user": "v0.1.0",
            "bagisto/laravel-admin": "v0.1.0",
            "bagisto/laravel-ui": "v0.1.0",
            "bagisto/laravel-core": "v0.1.0",
            "bagisto/laravel-attribute": "v0.1.0",
            "bagisto/laravel-checkout": "v0.1.0",
            "bagisto/laravel-customer": "v0.1.0",
            "bagisto/laravel-inventory": "v0.1.0",
            "bagisto/laravel-category": "v0.1.0",
            "bagisto/laravel-product": "v0.1.0",
            "bagisto/laravel-shop": "v0.1.0",
            "bagisto/laravel-theme": "v0.1.0",
            "bagisto/laravel-shipping": "v0.1.0",
            "bagisto/laravel-payment": "v0.1.0",
            "bagisto/laravel-sales": "v0.1.0",
            "bagisto/laravel-tax": "v0.1.0",
            "bagisto/laravel-api": "v0.1.0",
            "bagisto/laravel-paypal": "v0.1.0",
            "bagisto/laravel-discount": "v0.1.0"
        },
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/nckg/baum"
            }
        ],
        "autoload": {
            "files": [
                "app/Domain/helpers.php"
            ],
            "psr-4": {
                "App\\": "app/",
                "Database\\Factories\\": "database/factories/",
                "Database\\Seeders\\": "database/seeders/",
                "Database\\Factories\\": "database/factories/",
                "Database\\Seeders\\": "database/seeders/",
                "Webkul\\User\\": "packages/Webkul/User/src",
                "Webkul\\Admin\\": "packages/Webkul/Admin/src",
                "Webkul\\Ui\\": "packages/Webkul/Ui/src",
                "Webkul\\Category\\": "packages/Webkul/Category/src",
                "Webkul\\Checkout\\": "packages/Webkul/Checkout/src",
                "Webkul\\Attribute\\": "packages/Webkul/Attribute/src",
                "Webkul\\Shop\\": "packages/Webkul/Shop/src",
                "Webkul\\Core\\": "packages/Webkul/Core/src",
                "Webkul\\Customer\\": "packages/Webkul/Customer/src",
                "Webkul\\Inventory\\": "packages/Webkul/Inventory/src",
                "Webkul\\Product\\": "packages/Webkul/Product/src",
                "Webkul\\Theme\\": "packages/Webkul/Theme/src",
                "Webkul\\Shipping\\": "packages/Webkul/Shipping/src",
                "Webkul\\Payment\\": "packages/Webkul/Payment/src",
                "Webkul\\Paypal\\": "packages/Webkul/Paypal/src",
                "Webkul\\Sales\\": "packages/Webkul/Sales/src",
                "Webkul\\Tax\\": "packages/Webkul/Tax/src",
                "Webkul\\API\\": "packages/Webkul/API",
                "Webkul\\CatalogRule\\": "packages/Webkul/CatalogRule/src",
                "Webkul\\CartRule\\": "packages/Webkul/CartRule/src",
                "Webkul\\Rule\\": "packages/Webkul/Rule/src",
                "Webkul\\CMS\\": "packages/Webkul/CMS/src",
                "Webkul\\Velocity\\": "packages/Webkul/Velocity/src",
                "Webkul\\BookingProduct\\": "packages/Webkul/BookingProduct/src",
                "Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src",
                "Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src",
                "Webkul\\Marketing\\": "packages/Webkul/Marketing/src"
            }
        },
        "autoload-dev": {
            "psr-4": {
                "Tests\\": "tests/",
                "Tests\\Acceptance\\": "tests/acceptance/",
                "Tests\\Functional\\": "tests/functional/",
                "Tests\\Unit\\": "tests/unit/",
                "Tests\\Trigger\\": "tests/trigger/"
            }
        },
        "extra": {
            "laravel": {
                "dont-discover": [
                    "msurguy/honeypot"
                ]
            }
        },
        "scripts": {
            "check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 app",
            "fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 app &&  vendor/bin/php-cs-fixer fix",
            "check-mess": "vendor/bin/phpmd app text ./phpmd.xml",
            "post-root-package-install": [
                "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
            ],
            "post-create-project-cmd": [
                "@php artisan key:generate",
                "Webkul\\Core\\Events\\ComposerEvents::postCreateProject"
            ],
            "post-autoload-dump": [
                "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
                "@php artisan package:discover"
            ],
            "post-update-cmd": [
                "@php artisan vendor:publish --tag=laravel-assets --ansi"
            ],
            "test": [
                "set -e",
                "@php artisan migrate:fresh --env=testing",
                "vendor/bin/codecept run unit",
                "vendor/bin/codecept run functional",
                "vendor/bin/codecept run trigger"
            ],
            "test-win": [
                "@set -e",
                "@php artisan migrate:fresh --env=testing",
                "vendor\\bin\\codecept.bat run unit",
                "vendor\\bin\\codecept.bat run functional",
                "vendor\\bin\\codecept.bat run trigger"
            ]
        },
        "config": {
            "preferred-install": "dist",
            "sort-packages": true,
            "optimize-autoloader": true
        }
    }
    
    



Log in to reply