Skip to content

Instantly share code, notes, and snippets.

@batbaatap
Last active May 9, 2021 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batbaatap/528e69caceb9b8c15dc4f5d654a01e63 to your computer and use it in GitHub Desktop.
Save batbaatap/528e69caceb9b8c15dc4f5d654a01e63 to your computer and use it in GitHub Desktop.
Date, check id in table
<?php
$request->validate([
'bookings' => 'required|array|min:1',
'bookings.*.hotelId' => 'required|exists:pm_hotel,id', // check id in pm_hotel
'bookings.*.from' => 'required|date',
'bookings.*.to' => 'required|date|after:bookings.*.from',
'bookings.*.night' => 'required|numeric|min:0|not_in:0',
'customer.first_name' => 'required|min:2',
]);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment