Target Class [... datagrid] does not exist issue only on live server
-
i have created an ecommerce website, lucnhed it on my local server, and i added a custom package called Careers, i followed the documentation carefully, and everything is working fine on my local server, then i published the website into a cpanel, when going to carrers tab, its giving an error that carreers datagrid does not exist, i tried to re-create it using cpanel terminal, and it said that its already existed. note that other packages is working just find, like there is a package called testomonials, and its working great with no errors, but some other packages is giving this error .
any help appreciated.
thanks
-
Hi @shartouny,
I think it's an autoload issue.
-
hello, i did composer dump, i did php artisan clear everything nothing worked
-
Hi @shartouny,
Can you share your composer.json file because it seems to be an autoload issue.
I just need two things first
composer.json
file and thelaravel.log
output to further investigate this. -
here is the composer.json :
{
"name": "bagisto/bagisto",
"description": "Bagisto Laravel E-Commerce",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.2.5",
"ext-curl": "",
"ext-intl": "",
"ext-mbstring": "",
"ext-openssl": "",
"ext-pdo": "",
"ext-pdo_mysql": "",
"ext-tokenizer": "*",
"algolia/algoliasearch-client-php": "^2.2",
"astrotomic/laravel-translatable": "^11.0.0",
"aws/aws-sdk-php": "^3.171",
"babenkoivan/elastic-scout-driver": "^1.1",
"bagisto/bagisto-package-generator": "dev-master",
"bagistobrasil/bagisto-product-social-share": "^0.1.2",
"barryvdh/laravel-debugbar": "^3.1",
"barryvdh/laravel-dompdf": "0.8.6",
"doctrine/dbal": "2.9.2",
"fideloper/proxy": "^4.2",
"flynsarmy/db-blade-compiler": "^5.5",
"fzaninotto/faker": "^1.4",
"guzzlehttp/guzzle": "~6.3",
"intervention/image": "^2.4",
"intervention/imagecache": "^2.3",
"kalnoy/nestedset": "5.0.1",
"khaled.alshamaa/ar-php": "^6.0.0",
"konekt/concord": "^1.2",
"laravel/framework": "^7.0",
"laravel/scout": "^8.0",
"laravel/socialite": "^4.4",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"maatwebsite/excel": "^3.1.26",
"paypal/paypal-checkout-sdk": "1.0.1",
"prettus/l5-repository": "^2.6",
"tymon/jwt-auth": "^1.0.0"
},
"require-dev": {
"codeception/codeception": "4.1.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",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"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"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\": "app/",
"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",
"GTEC\GEvents\": "packages/GTEC/GEvents/src",
"GTEC\News\": "packages/GTEC/News/src",
"GTEC\Brands\": "packages/GTEC/Brands/src",
"GTEC\OurCatalogs\": "packages/GTEC/OurCatalogs/src",
"GTEC\Careers\": "packages/GTEC/Careers/src",
"GTEC\EndUser\": "packages/GTEC/EndUser/src",
"GTEC\OurResellersPartners\": "packages/GTEC/OurResellersPartners/src",
"GTEC\Courses\": "packages/GTEC/Courses/src",
"GTEC\AcademyApplicants\": "packages/GTEC/AcademyApplicants/src",
"GTEC\ReturnReasons\": "packages/GTEC/ReturnReasons/src",
"GTEC\ReturnConditions\": "packages/GTEC/ReturnConditions/src",
"GTEC\Returns\": "packages/GTEC/Returns/src",
"GTEC\Testomonials\": "packages/GTEC/Testomonials/src"
},
"files": ["app/helpers.php"]
},
"autoload-dev": {
"psr-4": {
"Tests\Acceptance\": "tests/acceptance/",
"Tests\Functional\": "tests/functional/",
"Tests\Unit\": "tests/unit/",
"Tests\Trigger\": "tests/trigger/"
}
},
"extra": {
"laravel": {
"dont-discover": [
"laravel/dusk"
]
}
},
"scripts": {
"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"
],
"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": "stable",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
} -
[2021-10-11 17:38:53] local.ERROR: Target class [GTEC\OurCatalogs\DataGrids\OurCatalogsDataGrid] does not exist. (View: /home/downet/gtec/packages/GTEC/OurCatalogs/src/Resources/views/admin/index.blade.php) {"exception":"[object] (ErrorException(code: 0): Target class [GTEC\OurCatalogs\DataGrids\OurCatalogsDataGrid] does not exist. (View: /home/downet/gtec/packages/GTEC/OurCatalogs/src/Resources/views/admin/index.blade.php) at /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Container/Container.php:811)
[stacktrace]
#0 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(43): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(Illuminate\Contracts\Container\BindingResolutionException), 0)
#1 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(57): Illuminate\View\Engines\PhpEngine->evaluatePath('/home/downet/gt...', Array)
#2 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\View\Engines\CompilerEngine->get('/home/downet/gt...', Array)
#3 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\View\View->getContents()
#4 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\View\View->renderContents()
#5 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Http/Response.php(62): Illuminate\View\View->render()
#6 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Http/Response.php(34): Illuminate\Http\Response->setContent(Object(Illuminate\View\View))
#7 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(759): Illuminate\Http\Response->__construct(Object(Illuminate\View\View), 200, Array)
#8 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(731): Illuminate\Routing\Router::toResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#9 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(685): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
#10 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#11 /home/downet/gtec/packages/Webkul/User/src/Http/Middleware/Bouncer.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Webkul\User\Http\Middleware\Bouncer->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#14 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#15 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#23 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#24 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#25 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#26 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#27 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#28 /home/downet/gtec/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#32 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /home/downet/gtec/packages/Webkul/Core/src/Http/Middleware/CheckForMaintenanceMode.php(117): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Webkul\Core\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#41 /home/downet/gtec/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#42 /home/downet/gtec/public/index.php(74): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#43 {main}log file
-
Hi @shartouny,
It should be double slashes like this,
https://github.com/bagisto/bagisto/blob/f38ad8c4f05ec5fb988d4cef43873a7f2a2e2338/composer.json#L76 -
it is double but when I pasted the code here something didn't accept the double slashes, this isn't the problem sir otherwise all the classes wont work
-
thanks for sharing
-
Is there a solution to this problem?
-
It's just an autoloading issue. Check the class name and namespace.
-
has anyone found a solution for this issue ?