Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

borsatti's avatar

Lang problem.

$messages = [
            'idCategoria.required' => Lang::get('forms.categoria'),
            'urgencia.required' => Lang::get('forms.urgencia'),
            'nome.required' => Lang::get('forms.nome'),
            'email.required' => Lang::get('forms.email'),
            'email.email' => Lang::get('forms.email.type'),
            'celular.required' => Lang::get('forms.celular'),
            'titulo.required' => Lang::get('forms.titulo'),
            'descCliente.required' => Lang::get('forms.descCliente'),
            'descAtendente.required' => Lang::get('forms.descAtendente'),
            'arquivo.image' => Lang::get('forms.image'), 
            'arquivo.max' => Lang::get('forms.file.max', ['size' => '3mb']),
            'arquivo.mimes' => Lang::get('forms.file.mimes_image')
        ];

This line

'arquivo.max' => Lang::get('forms.file.max', ['size' => '3mb']),

I need replace size for 3mb. And my messages archive is

<?php

return [
    'email' => 'O campo e-mail é obrigatório.',
    'email.type' => 'O campo e-mail deve ter o formato nome@dominio.',
    'categoria' => 'Selecione uma categoria.',
    'urgencia' => 'Escolha o nível de urgência desse ticket.',
    'nome' => 'Digite seu nome.',
    'celular' => 'Informe um número de celular.',
    'titulo' => 'Informe o que está ocorrendo.',
    'descCliente' => 'Por favor, descreva o que está ocorrendo com o máximo de detalhes.',
    'descAtendente' => 'Por favor, descreva o que está ocorrendo com o máximo de detalhes.',
    'image' => 'O arquivo deve ser uma imagem(jpg,png,gif).',
    'file.max' => 'O arquivo deve ter no máximo :size .',
    'file.mimes_image' => 'O arquivo deve ser uma imagem(jpg,jpeg,png,gif).'
];

All messages working. But this line return error

'file.max' => 'O arquivo deve ter no máximo :size .',
0 likes
10 replies
mstnorris's avatar

Use double quotes

'file.max' => "O arquivo deve ter no máximo :size .",
borsatti's avatar

Not working yet.

<?php

return [
    "email" => "O campo e-mail é obrigatório.",
    "email.type" => "O campo e-mail deve ter o formato nome@dominio.",
    "categoria" => "Selecione uma categoria.",
    "urgencia" => "Escolha o nível de urgência desse ticket.",
    "nome" => "Digite seu nome.",
    "celular" => "Informe um número de celular.",
    "titulo" => "Informe o que está ocorrendo.",
    "descCliente" => "Por favor, descreva o que está ocorrendo com o máximo de detalhes.",
    "descAtendente" => "Por favor, descreva o que está ocorrendo com o máximo de detalhes.",
    "image" => "O arquivo deve ser uma imagem(jpg,png,gif).",
    "file.max" => "O arquivo deve ter no máximo :size .",
    "file.mimes_image" => "O arquivo deve ser uma imagem(jpg,jpeg,png,gif)."
];
borsatti's avatar
[2015-06-01 15:38:14] local.ERROR: exception 'ErrorException' with message 'Missing argument 2 for Illuminate\Translation\Translator::Illuminate\Translation\{closure}(), called in /Users/roberto/Projetos/tickets/vendor/compiled.php on line 11547 and defined' in /Users/roberto/Projetos/tickets/vendor/laravel/framework/src/Illuminate/Translation/Translator.php:148
mstnorris's avatar

Have you edited your composer.json file?

Run composer dump-autoload -o

borsatti's avatar

Mac-mini-de-Roberto:tickets roberto$ php composer.phar dump-autoload -o Generating optimized autoload files

borsatti's avatar

@sitesense I see, and i tried, but i got that error:

Script php artisan clear-compiled handling the post-update-cmd event returned with an error



  [RuntimeException]
  Error Output: PHP Fatal error:  Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath() in /Users/roberto/Projetos/tickets/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php on line 28

mstnorris's avatar
Level 55

@borsatti delete the vendor/compiled.php and the storage/framework/compiled.php run composer update and if it isn't run automatically; php artisan optimise to compile again.

1 like

Please or to participate in this conversation.