Class Carbon\Carbon not found

后端 未结 8 1223
无人及你
无人及你 2020-12-24 12:17

I recently added a package to my Laravel 4 site and now anything that uses Eloquent (or at least Eloquent with any reference to date/time) is showing a 500 error that states

相关标签:
8条回答
  • 2020-12-24 12:50

    For all updated version you just need to

    use Carbon\Carbon;
    

    and for the global use, you can add this in app.php

    'Carbon' => 'Carbon\Carbon',

    0 讨论(0)
  • 2020-12-24 12:52

    My problem solved by just requiring nesbot/carbon just do this:

    composer require nesbot/carbon
    
    0 讨论(0)
提交回复
热议问题