gpt4 book ai didi

php - 类 'App\Carbon\Carbon' 未找到 Laravel 5

转载 作者:可可西里 更新时间:2023-11-01 13:07:47 25 4
gpt4 key购买 nike

我最近运行 sudo composer update

现在在我的一个页面上,我不断收到

enter image description here

我用过

$now = Carbon\Carbon::now('America/New_York');

在我的 Helper.php 上的 792

我的 Helper.php 位于 app/Helper.php

我该如何防止这种情况发生?


这是我的别名

'aliases' => [

'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Input' => Illuminate\Support\Facades\Input::class,
'Inspiring' => Illuminate\Foundation\Inspiring::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,

/*
* Extra Alias ...
*/

'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',

/*
* Custom ...
*/

'VSE' => App\VSE::class,
'Helper' => App\Helper::class,
'DateHelper' => App\Helpers\DateHelper::class,
'DD' => App\Helpers\DD::class,
'Facebook' => SammyK\LaravelFacebookSdk\FacebookFacade::class,


],

最佳答案

在帮助文件的上下文中,我相信 Carbon\Carbon = App\Carbon\Carbon

\Carbon\Carbon 会提取您想要的内容!

在开头使用\是指一种全局命名空间。

关于php - 类 'App\Carbon\Carbon' 未找到 Laravel 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39902831/

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