Json 拉威尔5.7级';照明\Support\Facades\Lang';找不到
我最近遇到了这个错误:Json 拉威尔5.7级';照明\Support\Facades\Lang';找不到,json,laravel,notifications,lang,reset-password,Json,Laravel,Notifications,Lang,Reset Password,我最近遇到了这个错误: Class 'Illuminate\Support\Facades\Lang'not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Illuminate\\Support\\Facades\\Lang' not found at vendor/laravel/framework/src/Illumi
Class 'Illuminate\Support\Facades\Lang'not found
{"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Illuminate\\Support\\Facades\\Lang'
not found at vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php:60)
我必须更改代码表:
return (new MailMessage)
->subject(Lang::getFromJson('Reset Password Notification'))
->line(Lang::getFromJson('You are receiving this email because we received a password reset request for your account.'))
->action(Lang::getFromJson('Reset Password'), url(config('app.url').route('password.reset', $this->token, false)))
->line(Lang::getFromJson('If you did not request a password reset, no further action is required.'));
致:
这是可行的,但每次更新后我都要这么做
文件vendor\laravel\framework\illumb\Support\Facades\Lang.php:
<?php
namespace Illuminate\Support\Facades;
/**
* @method static mixed trans(string $key, array $replace = [], string $locale = null)
* @method static string transChoice(string $key, int|array|\Countable $number, array $replace = [], string $locale = null)
* @method static string getLocale()
* @method static void setLocale(string $locale)
* @method static string|array|null get(string $key, array $replace = [], string $locale = null, bool $fallback = true)
*
* @see \Illuminate\Translation\Translator
*/
class Lang extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'translator';
}
}
像@ceejayoz suggest一样,删除供应商文件夹并运行composer安装
解决了问题
谢谢大家的帮助 在vendor/laravel/framework/src/illusted/Support/Facades/Lang.php中是否有文件?是的,文件存在。我首先尝试清除vendor
并重新安装composer
。这将防止权限问题,并为您提供一组干净的文件。composer install
将重新生成vendor
目录。如果删除vendor目录,则会重新生成该目录<代码>供应商
不应包含手动修改的代码,因此删除它并使用composer安装重新生成它
应修复任何依赖性问题,正如ceejayoz多次建议的那样。
<?php
namespace Illuminate\Support\Facades;
/**
* @method static mixed trans(string $key, array $replace = [], string $locale = null)
* @method static string transChoice(string $key, int|array|\Countable $number, array $replace = [], string $locale = null)
* @method static string getLocale()
* @method static void setLocale(string $locale)
* @method static string|array|null get(string $key, array $replace = [], string $locale = null, bool $fallback = true)
*
* @see \Illuminate\Translation\Translator
*/
class Lang extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'translator';
}
}