Have you changed the language in config/app.php?
Have you added the translations for french in resources/lang?
If not, you can get translations for the default files here: https://github.com/caouecs/Laravel-lang
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, i'm working on making my website muti lang' (eng and french), but i don't know how to translate error validation messages , here's my controller
public function store()
{
request()->validate([
'title' => 'required',
'body' => 'required',
'channel_id' => 'required|exists:channels,id',
'wilaya' => 'required',
'type' =>'required',
$thread = Thread::create([
'user_id' => auth()->id(),
'channel_id' => request('channel_id'),
'wilaya' => request('wilaya'),
'title' => request('title'),
'body' => request('body'),
'type' =>request('type')
]);
if (request()->wantsJson()) {
return response($thread, 201);
}
return redirect($thread->path())
->with('flash', 'Your thread has been published!');
}
so the problem is , if i set to french, and try to create a thread, the error message is displayed in english, i know i view for example we need to write
trans('file.smth')
is it the same in controller ? because when i did this, nothing changed, please help
Please or to participate in this conversation.