Closed khaledBawz closed 4 years ago
Hi @khaledBawz, if you can provide the entire stack trace that will help us debug the issue. Thanks! :)
i have same issue 😢
MapMarker::make('Harita', 'map')
->defaultZoom(14)
->latitude('latitude')
->longitude('longitude')
->defaultLatitude(39.909544)
->defaultLongitude(32.8490746)
->hideFromIndex(),
[2020-09-01 08:16:17] staging.ERROR: Illegal offset type {"userId":1,"exception":"[object] (ErrorException(code: 0): Illegal offset type at /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/PerformsValidation.php:273)
[stacktrace]
#0 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/PerformsValidation.php(273): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'Illegal offset ...', '/Users/semihkes...', 273, Array)
#1 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Support/Collection.php(685): Laravel\\Nova\\Resource::Laravel\\Nova\\{closure}(Object(GeneaLabs\\NovaMapMarkerField\\MapMarker), 14)
#2 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/PerformsValidation.php(274): Illuminate\\Support\\Collection->mapWithKeys(Object(Closure))
#3 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/PerformsValidation.php(85): Laravel\\Nova\\Resource::attributeNamesForFields(Object(Laravel\\Nova\\Http\\Requests\\UpdateResourceRequest))
#4 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Controllers/ResourceUpdateController.php(26): Laravel\\Nova\\Resource::validateForUpdate(Object(Laravel\\Nova\\Http\\Requests\\UpdateResourceRequest), Object(App\\Nova\\Address))
#5 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(28): Laravel\\Nova\\Http\\Controllers\\ResourceUpdateController->Laravel\\Nova\\Http\\Controllers\\{closure}(Object(Illuminate\\Database\\MySqlConnection))
#6 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(367): Illuminate\\Database\\Connection->transaction(Object(Closure))
#7 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Database\\DatabaseManager->__call('transaction', Array)
#8 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Controllers/ResourceUpdateController.php(41): Illuminate\\Support\\Facades\\Facade::__callStatic('transaction', Array)
#9 [internal function]: Laravel\\Nova\\Http\\Controllers\\ResourceUpdateController->handle(Object(Laravel\\Nova\\Http\\Requests\\UpdateResourceRequest), 'addresses', '261')
#10 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#11 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('handle', Array)
#12 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Route.php(239): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Laravel\\Nova\\Http\\Controllers\\ResourceUpdateController), 'handle')
#13 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Route.php(196): Illuminate\\Routing\\Route->runController()
#14 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Router.php(685): Illuminate\\Routing\\Route->run()
#15 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#16 /Users/semihkeskin/Projects/yeniben/vendor/vyuldashev/nova-permission/src/ForgetCachedPermissions.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Vyuldashev\\NovaPermission\\ForgetCachedPermissions->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Middleware/Authorize.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#20 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Middleware/BootTools.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#21 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\BootTools->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#22 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#23 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#24 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#25 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#26 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#27 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Middleware/Authenticate.php(31): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(77): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /Users/semihkeskin/Projects/yeniben/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))
#35 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#38 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#42 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#43 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#44 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#45 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#46 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#47 /Users/semihkeskin/Projects/yeniben/vendor/laravel/nova/src/Http/Middleware/ServeNova.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /Users/semihkeskin/Projects/yeniben/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(65): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#55 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#56 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#59 /Users/semihkeskin/Projects/yeniben/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#60 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#61 /Users/semihkeskin/Projects/yeniben/vendor/fruitcake/laravel-cors/src/HandleCors.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#62 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#63 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#64 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#65 /Users/semihkeskin/Projects/yeniben/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#66 /Users/semihkeskin/Projects/yeniben/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#67 /Users/semihkeskin/.composer/vendor/laravel/valet/server.php(191): require('/Users/semihkes...')
#68 {main}
"}
Same issue, the problem happens whenever you submit a form containing the MapMarker component, to be specific
file nova/src/PerformsValidation.php
line 273 return [$item->attribute => $item->name];
throws an ErrorException
because $item->attribute
returns an array containing the component object's attributes
Laravel v7.25 Nova v3.8.4
@semihkeskindev Thanks for the additional details. I will work on a fix.
Looks like this is a recent change in Nova that broke this. Working on it now.
I have updated composer dependency restrictions to work with Nova 3.8.3 or lower until a permanent solution can be found.
Opened issue with Nova: https://github.com/laravel/nova-issues/issues/2834
@khaledBawz @semihkeskindev @abdulfattah-tayih-mawdoo3 Would you guys mind testing release 0.2.2 and let me know if it works? I think I found a work-around to the problem.
Hello,
First, I would like to thank you for the great package. Recently, I have the issue 'illegal offset type' whenever I want to create a resource. I think this happened in Laravel Nova v3.8.4 because before that I was able to create a resource fine.
here is my code,
is there any temporary solution for this issue? Thank you.