Hello,
I'm trying to create my first validation file and I don't know how to make that the dateStart =< dateEnd. I've searched on Google and I looked at the docs but I don't find it. I think that this should be very easy to do :/
public function rules()
{
return [
'name' => 'required|max:255',
'dateStart' => 'required|date',
'dateEnd' => 'required|date|after:dateStart',
];
}
Another question is, What is the better way to validate that a user is owning a message (for example) and he can edit this message. If the user_id of the message don't match with the Auth:user, the user should not be able to edit. What is the cleaner way? I searched on google but there is a lot of possible answers.