windows环境php8.1引入illuminate后报错

allenworker

如题,报错具体内容如下:

Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Database\Eloquent\Model::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or th
e #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\personal\php\saas_webman\vendor\illuminate\database\Eloquent\Model.php:1650
Stack trace:
#0 D:\personal\php\saas_webman\vendor\illuminate\database\Eloquent\Model.php(23): {closure}(8192, 'Return type of ...', 'D:\\personal\\php...', 1650)
#1 D:\personal\php\saas_webman\vendor\composer\ClassLoader.php(571): include('D:\\personal\\php...')
#2 D:\personal\php\saas_webman\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('D:\\personal\\php...')
#3 D:\personal\php\saas_webman\vendor\illuminate\database\Capsule\Manager.php(135): Composer\Autoload\ClassLoader->loadClass('Illuminate\\Data...')
#4 D:\personal\php\saas_webman\support\bootstrap\LaravelDb.php(71): Illuminate\Database\Capsule\Manager->bootEloquent()
#5 D:\personal\php\saas_webman\support\bootstrap.php(70): support\bootstrap\LaravelDb::start(Object(Workerman\Worker))
#6 D:\personal\php\saas_webman\start.php(67): require_once('D:\\personal\\php...')
#7 D:\personal\php\saas_webman\vendor\workerman\workerman\Worker.php(2405): {closure}(Object(Workerman\Worker))
#8 D:\personal\php\saas_webman\vendor\workerman\workerman\Worker.php(1406): Workerman\Worker->run()
#9 D:\personal\php\saas_webman\vendor\workerman\workerman\Worker.php(1349): Workerman\Worker::forkWorkersForWindows()
#10 D:\personal\php\saas_webman\vendor\workerman\workerman\Worker.php(542): Workerman\Worker::forkWorkers()
#11 D:\personal\php\saas_webman\start.php(87): Workerman\Worker::runAll()
#12 {main} in D:\personal\php\saas_webman\vendor\illuminate\database\Eloquent\Model.php on line 23

请教各位大神,是否是版本问题还是其他问题

问题已解决illuminate/database更新到8.80就可以了

3542 1 0
1个回答

Tinywan

你这是 Illuminate\Database 不支持8.1导致的

  • yzh52521 2022-01-19

    8.1 想用Illuminate\Database 等 laravel 9

  • Tinywan 2022-01-19

    我用的ThinkORM,已经支持了哈

年代过于久远,无法发表回答
×
🔝