gpt4 book ai didi

php - Laravel-尝试访问类型为int的值的数组偏移量

转载 作者:行者123 更新时间:2023-12-03 11:22:15 25 4
gpt4 key购买 nike

尝试将发布请求提交到数据库时出现问题。
有趣的是,该错误仅在我使用PHP版本7.4.2时发生。
在PHP 7.3.9版中,一切正常。
我正在使用Laravel 6.17。

Laravel什么时候可以解决这个问题?

当出现错误时,这就是我的堆栈跟踪。

Trying to access array offset on value of type int   
in CreateCourseController.php line 176
at HandleExceptions->handleError()
in CreateCourseController.php line 176
at CreateCourseController->createDates()
in CreateCourseController.php line 101
at CreateCourseController->createCourse()
at call_user_func_array()
in Controller.php line 54
at Controller->callAction()
in ControllerDispatcher.php line 45
at ControllerDispatcher->dispatch()
in Route.php line 219
at Route->runController()
in Route.php line 176
at Route->run()
in Router.php line 681
at Router->Illuminate\Routing\{closure}()
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}()
in SubstituteBindings.php line 41
at SubstituteBindings->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in VerifyCsrfToken.php line 76
at VerifyCsrfToken->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in StartSession.php line 56
at StartSession->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in EncryptCookies.php line 66
at EncryptCookies->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in Pipeline.php line 105
at Pipeline->then()
in Router.php line 683
at Router->runRouteWithinStack()
in Router.php line 658
at Router->runRoute()
in Router.php line 624
at Router->dispatchToRoute()
in Router.php line 613
at Router->dispatch()
in Kernel.php line 170
at Kernel->Illuminate\Foundation\Http\{closure}()
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}()
in TransformsRequest.php line 21
at TransformsRequest->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in TransformsRequest.php line 21
at TransformsRequest->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in ValidatePostSize.php line 27
at ValidatePostSize->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in CheckForMaintenanceMode.php line 63
at CheckForMaintenanceMode->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in TrustProxies.php line 57
at TrustProxies->handle()
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}()
in Pipeline.php line 105
at Pipeline->then()
in Kernel.php line 145
at Kernel->sendRequestThroughRouter()
in Kernel.php line 110
at Kernel->handle()
in index.php line 55

问候

最佳答案

composer update适用于我的情况:
我有一个Laravel 5.6应用程序,带有Php 7.1
另外,我不得不将laracasts/generators中的composer.json^1.0更改为dev-master,以使composer update正常运行,就像这样:"laracasts/generators": "^1.0"开始在某些旧项目上解决此问题后,就在php artisan migrate之后的composer install上发生了此问题。
https://github.com/spatie/laravel-permission/issues/1370#issuecomment-676556816

关于php - Laravel-尝试访问类型为int的值的数组偏移量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60412946/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com