Prevent translation logs for validation rules.

This commit is contained in:
2024-11-27 11:42:48 +01:00
parent 84951052f0
commit 1ba2ae6fd2

View File

@@ -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,