validasi nilai parameter get pada laravel


berikut cara validasi nilai parameter yang dikirim dengan method  get pada laravel     


$doctor_id=$request->doctor_id;
$limit=$request->limit;
$offset=$request->offset;
 
$r = [
            'doctor_id' => $doctor_id,
            'limit' => $limit,
            'offset' => $offset,
        ];

        $validator = Validator::make($r, [
            'doctor_id' => 'required|numeric|min:1|exists:doctors,id',
            'limit' => 'required|numeric|min:1',
            'offset' => 'required|numeric|min:0',
        ]);

semoga berguna :)

referensi :

Ditulis dalam php. Leave a Comment »

tinggalkan pesan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d blogger menyukai ini: