Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Code Examples of custom validation rules

Discover how to use Laravel's custom validation rules method in real-world applications. Browse 23 examples from popular open-source projects.

23 examples

firefly-iii/firefly-iii

  • 21505
  • Created Jun 2014
  • Updated Nov 2025

Files in this example

  • app/Rules/IsBoolean.php
    • app/Api/V1/Requests/Models/Rule/StoreRequest.php
View full example

pterodactyl/panel

  • 8314
  • Created Dec 2016
  • Updated Nov 2025

Files in this example

  • app/Rules/Username.php
    • app/Models/User.php
View full example

bytefury/crater

  • 8213
  • Created Nov 2019
  • Updated Aug 2024

Files in this example

  • app/Rules/Backup/PathToZip.php
    • app/Http/Controllers/V1/Backup/DownloadBackupController.php
View full example

unopim/unopim

  • 7807
  • Created Jul 2024
  • Updated Nov 2025

Files in this example

  • packages/Webkul/DataTransfer/src/Rules/SeparatorTypes.php
    • packages/Webkul/Admin/src/Http/Controllers/Settings/DataTransfer/ExportController.php
View full example

JhumanJ/OpnForm

  • 3005
  • Created Sep 2022
  • Updated Nov 2025

Files in this example

  • app/Rules/OneEmailPerLine.php
    • app/Http/Requests/UserFormRequest.php
View full example

laravelio/laravel.io

  • 2497
  • Created May 2016
  • Updated Nov 2025

Files in this example

  • app/Rules/PasscheckRule.php
    • app/Http/Requests/UpdatePasswordRequest.php
View full example

HDInnovations/UNIT3D-Community-Edition

  • 2239
  • Created Dec 2017
  • Updated Nov 2025

Files in this example

  • app/Validators/EmailBlacklistValidator.php
    • app/Providers/EmailBlacklistServiceProvider.php
      • config/email-blacklist.php
        • app/Http/Controllers/Auth/ApplicationController.php
          • app/Helpers/EmailBlacklistUpdater.php
            • config/app.php
View full example

guillaumebriday/laravel-blog

  • 1797
  • Created Dec 2016
  • Updated Oct 2024

Files in this example

  • app/Rules/AlphaName.php
    • app/Http/Requests/UsersRequest.php
View full example

pinkary-project/pinkary.com

  • 1505
  • Created Mar 2024
  • Updated Nov 2025

Files in this example

  • app/Rules/NoBlankCharacters.php
    • app/Http/Requests/UserUpdateRequest.php
View full example

realodix/urlhub

  • 532
  • Created Aug 2018
  • Updated Nov 2025

Files in this example

  • app/Rules/StrAlphaUnderscore.php
    • app/Http/Requests/StoreUrl.php
      • app/Http/Controllers/UrlController.php
View full example

protonemedia/eddy-server-management

  • 507
  • Created May 2023
  • Updated Aug 2024

Files in this example

  • app/Rules/FirewallPort.php
    • app/Http/Controllers/FirewallRuleController.php
View full example

spatie/spatie.be

  • 493
  • Created Oct 2020
  • Updated Nov 2025

Files in this example

  • app/Rules/MatchingLicense.php
    • app/Http/Api/Requests/Activations/ShowActivationRequest.php
      • resources/views/components/field.blade.php
View full example

christophrumpel/larastreamers

  • 238
  • Created May 2021
  • Updated Oct 2025

Files in this example

  • app/Rules/YouTubeRule.php
    • app/Http/Livewire/SubmitYouTubeLiveStream.php
View full example

LaraBug/larabug-app

  • 218
  • Created Apr 2021
  • Updated Oct 2023

Files in this example

  • app/Rules/StartsWith.php
    • app/Http/Requests/ProjectRequest.php
View full example

jcergolj/laravellte

  • 216
  • Created Jan 2020
  • Updated Feb 2023

Files in this example

  • app/Rules/PasswordCheckRule.php
    • app/Http/Livewire/Profile/UpdatePassword.php
View full example

JustinByrne/Mealing

  • 99
  • Created Oct 2020
  • Updated Sep 2022

Files in this example

  • app/Rules/CurrentPasswordRule.php
    • app/Http/Requests/ChangePasswordRequest.php
      • app/Http/Controllers/ProfileController.php
View full example

cattr-app/server-application

  • 87
  • Created Mar 2023
  • Updated Jan 2025

Files in this example

  • app/Rules/TimeIntervalDoesNotExist.php
    • app/Http/Requests/Interval/CreateTimeIntervalRequest.php
View full example

caneara/lumeno

  • 14
  • Created Dec 2022
  • Updated Dec 2022

Files in this example

  • app/Rules/MaxYearsExperienceRule.php
    • app/Requests/Requirement/StoreRequest.php
View full example

caneara/tipsea

  • 13
  • Created Dec 2022
  • Updated Dec 2022

Files in this example

  • app/Rules/ForbiddenContentRule.php
    • app/Requests/Account/UpdateRequest.php
View full example

Ayenko4all/school-management-system-backend

  • 12
  • Created Aug 2021
  • Updated Nov 2021

Files in this example

  • app/Rules/CreateClassroomRule.php
    • app/Http/Requests/CreateClassroomRequest.php
View full example

Melcus/parking-system

  • 10
  • Created May 2021
  • Updated Feb 2022

Files in this example

  • app/Rules/ExistingReservationRuleForInterval.php
    • app/Http/Requests/ReservationCreateRequest.php
View full example

archboard/tidal-ptc

  • 4
  • Created Dec 2023
  • Updated Sep 2025

Files in this example

  • app/Rules/ValidLicense.php
    • app/Forms/Traits/ValidatesTenantFields.php
View full example

RatulSaqibKhan/emoji-calculator-laravel

  • 1
  • Created Sep 2021
  • Updated Nov 2021

Files in this example

  • app/Rules/OperandRule.php
    • app/Http/Requests/CalculatorRequest.php
View full example

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.