Skip to content

Instantly share code, notes, and snippets.

@GeniJaho
Created April 28, 2022 14:22
12 - UpdateSettingsRequest
<?php
class UpdateSettingsRequest extends FormRequest
{
...
public function rules()
{
return [
'social_twitter' => 'nullable|url',
'social_facebook' => 'nullable|url',
'social_instagram' => 'nullable|url',
'social_linkedin' => 'nullable|url',
'social_reddit' => 'nullable|url',
'social_personal' => 'nullable|url',
];
}
public function messages()
{
return [
'social_twitter.url' => 'The Twitter URL is invalid.',
'social_facebook.url' => 'The Facebook URL is invalid.',
'social_instagram.url' => 'The Instagram URL is invalid.',
'social_linkedin.url' => 'The LinkedIn URL is invalid.',
'social_reddit.url' => 'The Reddit URL is invalid.',
'social_personal.url' => 'The personal website\'s URL is invalid.',
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment