How to validate URL with https using regex in laravel

You can validate URL in laravel by creating a regex. You can create your own regex and use regex rules to validate the URL in laravel.

Answers 1
  • Laravel URL validation with https using regex

    //Inside controller's method
    $regex = '/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/';
        'url' => 'required|regex:'.$regex,
  • Back to code snippet queries related laravel