Answers for "laravel 8 regex validation"

PHP
3

enie letter validation laravel regex

return [
                    'fname' => 'required|max:255|regex:/^[a-zA-ZÑñ\s]+$/',
                    'lname' => 'required|max:255|regex:/^[a-zA-ZÑñ\s]+$/',
                    'mname' => 'max:255|alpha',
                     'file' => 'image|mimes:jpg,jpeg,png',
               'contact_no' => 'regex:/^[-0-9\+]+$/',
            'date_of_birth' => 'required|date_format:Y-m-d',
                'school_id' => 'required|exists:schools,id',
                'degree_id' => 'required|exists:degrees,id',
        ];
Posted by: Guest on October-29-2020
4

laravel validation

/**
 * Store a new blog post.
 *
 * @param  Request  $request
 * @return Response
 */
public function store(Request $request)
{
    $validatedData = $request->validate([
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ]);

    // The blog post is valid...
}
Posted by: Guest on October-19-2020
0

laravel validation

use Illuminate\Validation\Rule;

Validator::make($data, [
    'email' => [
        'required',
        Rule::unique('users')->ignore($user->id),
    ],
]);
Posted by: Guest on December-25-2020

Code answers related to "laravel 8 regex validation"

Browse Popular Code Answers by Language