Кемеровские программисты php общаются здесь
Anonymous
@error не показывает ошибки в Laravel
Сообщение
Anonymous » 23 апр 2024, 02:08
В Blade не отображается ни одна @error, а в @foreach ($errors->all() as $error) отображаются все ошибки.
это проверка
Код: Выделить всё
public function updateAthlete(){
$pass = Hash::make($this->password);
$info = Athlete::find($this->athlete_id);
if($this->profile_photo_path){
File::delete('storage/' . $this->filePath);
$this->filePath = $this->profile_photo_path->store('AthletesProfile', 'public');
}
$this->validate([
'name' =>'required|max:70|min:3',
'name_fa' =>'required|max:70|min:3',
'name_pa' =>'required|max:70|min:3',
]);
$info->update([
'name' => $this->name,
'name_fa' => $this->name_fa,
'name_pa' => $this->name_pa,
]);
session()->flash('updated', 'Post successfully updated.');
}
а это форма
Код: Выделить всё
Name in Farsi
@error('name_fa') {{ $message }} @enderror
в консоли не было ошибок или дело не в стиле
Подробнее здесь:
https://stackoverflow.com/questions/655 ... in-laravel
1713827288
Anonymous
В Blade не отображается ни одна @error, а в @foreach ($errors->all() as $error) отображаются все ошибки. это проверка [code]public function updateAthlete(){ $pass = Hash::make($this->password); $info = Athlete::find($this->athlete_id); if($this->profile_photo_path){ File::delete('storage/' . $this->filePath); $this->filePath = $this->profile_photo_path->store('AthletesProfile', 'public'); } $this->validate([ 'name' =>'required|max:70|min:3', 'name_fa' =>'required|max:70|min:3', 'name_pa' =>'required|max:70|min:3', ]); $info->update([ 'name' => $this->name, 'name_fa' => $this->name_fa, 'name_pa' => $this->name_pa, ]); session()->flash('updated', 'Post successfully updated.'); } [/code] а это форма [code] Name in Farsi @error('name_fa') {{ $message }} @enderror [/code] в консоли не было ошибок или дело не в стиле Подробнее здесь: [url]https://stackoverflow.com/questions/65548537/the-error-not-showing-the-errors-in-laravel[/url]