davy_yg
286
5
Laravel

Custom email message

Posted 7 months ago by davy_yg

Hello,

I would like to create a custom email message. Can anyone help?

I only get this message: Please enter an email address

PageController.php

public function saveapps(Request $request) {

    Validator::make($request->all(), [
        
        "cover_letter" => "required|max:500",
        "nama" => "required",
        "jenis_kelamin" => "required",
        "tanggal_lahir" => "required",
        "nohp" => "required",
        "email" => "required|email",
        "alamat" => "required",
        "provinsi" => "required",
        "kota" => "required",
        "zip" => "required|integer",
        "status" => "required",
        "jumlah_tanggungan" => "required",
        "agama" => "required",
        "salary" => "required",
        "file_attachment" => "required",             
    ],
    [
        "cover_letter.max" => 'Maksimal 500 karakter', 
        "zip.integer" => 'Kode zip harus angka', 
        "email.email" => 'Tolong isi dengan format email',          
    ]
    )->validate();

form.blade.php

 @if ($errors->any())
          <div class="alert alert-danger">
              <ul>
                  @foreach ($errors->all() as $error)
                      <li>{{ $error }}</li>
                  @endforeach
              </ul>
          </div>
      @endif

...
    
<div class="mb-3">
          <label for="email">Email</label>
          <input type="email" class="form-control" id="email" name="email" placeholder="[email protected]">
          <div class="invalid-feedback">
            Mohon isi email Anda yang valid
          </div>
        </div>

Please sign in or create an account to participate in this conversation.