Carbon\Carbon 包含抽象方法,因此必须声明为抽象
Carbon\Carbon contains abstract methods and must therefore be declared abstract
我更新了我的作曲家,然后我正在尝试 运行 我的项目我不能!!
当我写
php artisan serve
我收到这个错误
Symfony\Component\Debug\Exception\FatalErrorException : Class Carbon\Carbon contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Carbon\CarbonInterface::__clone, Carbon\CarbonInterface::getLocalMacro, Carbon\CarbonInterface::getMacro, ...)
at /Users/macbook/Desktop/egydiet/vendor/nesbot/carbon/src/Carbon/Carbon.php:509
我正在链接到找到的解决方案 Fix: Class abstract methods。
When a class contains one or more abstract functions / methods, you must either:
Declare the class as an abstract class or
Implement the methods in the class that is extending your abstract class.
To fix the issue, we can make one simple change. Instead of writing:
<?php
class YourClassName{
你可以写-
<?php
abstract class YourClassName{
PHP 文档对此进行了详细介绍 HERE。
或者,Whosebug 中提供了一些很好的解释和答案 HERE。
我更新了我的作曲家,然后我正在尝试 运行 我的项目我不能!!
当我写
php artisan serve
我收到这个错误
Symfony\Component\Debug\Exception\FatalErrorException : Class Carbon\Carbon contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Carbon\CarbonInterface::__clone, Carbon\CarbonInterface::getLocalMacro, Carbon\CarbonInterface::getMacro, ...)at /Users/macbook/Desktop/egydiet/vendor/nesbot/carbon/src/Carbon/Carbon.php:509
我正在链接到找到的解决方案 Fix: Class abstract methods。
When a class contains one or more abstract functions / methods, you must either: Declare the class as an abstract class or Implement the methods in the class that is extending your abstract class. To fix the issue, we can make one simple change. Instead of writing:
<?php
class YourClassName{
你可以写-
<?php
abstract class YourClassName{
PHP 文档对此进行了详细介绍 HERE。
或者,Whosebug 中提供了一些很好的解释和答案 HERE。