Prevent translation logs for validation rules.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Translation\Translator as BaseTranslator;
|
||||
class Translator extends BaseTranslator
|
||||
{
|
||||
@@ -18,7 +19,7 @@ class Translator extends BaseTranslator
|
||||
{
|
||||
$translation = parent::get($key, $replace, $locale, $fallback);
|
||||
|
||||
if ($translation === $key) {
|
||||
if ($translation === $key && !Str::startsWith($key, 'validation.')) {
|
||||
Log::warning('Language item could not be found.', [
|
||||
'language' => $locale ?? config('app.locale'),
|
||||
'id' => $key,
|
||||
|
||||
Reference in New Issue
Block a user