Skip to content

Instantly share code, notes, and snippets.

@xemoe
Created November 13, 2018 12:14
Show Gist options
  • Save xemoe/84d849efc27b7f62b091ed1cfcffcc29 to your computer and use it in GitHub Desktop.
Save xemoe/84d849efc27b7f62b091ed1cfcffcc29 to your computer and use it in GitHub Desktop.
Laravel validate with combination fields
//
// Laravel validate with combination fields
//
// Use
//

return function($attributes) {
    return [
        'name' => ['required', CustomRule($attributes)],
    ];
}

//
// Instead of this
//

return [
    'name' => 'required',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment