“Status validasi Laravel” Kode Jawaban

Validasi email di Laravel

'email' => 'required|email|unique:users,email',
//@sujay
$uj@y

Jika ada kesalahan di Blade Laravel

 @if ($errors->any())
     @foreach ($errors->all() as $error)
         <div>{{$error}}</div>
     @endforeach
 @endif
Zamir

Validasi Laravel

$this->validate([ // 1st array is field rules
  'userid' =>'required|min:3|max:100',
  'username' =>'required|min:3',
  'password' =>'required|max:15|confirmed',
], [ // 2nd array is the rules custom message
  'required' => 'The :attribute field is mandatory.'
], [ // 3rd array is the fields custom name
  'userid' => 'User ID'
]);
hirohito

Status validasi Laravel

//Controller code

Route::post('/user/profile', function () {
    // ...
 
    return redirect('dashboard')->with('status', 'Profile updated!');
});

//view code

@if (session('status'))
    <div class="alert alert-success">
        {{ session('status') }}
    </div>
@endif
David Martínez L

Jawaban yang mirip dengan “Status validasi Laravel”

Pertanyaan yang mirip dengan “Status validasi Laravel”

Lebih banyak jawaban terkait untuk “Status validasi Laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya