Skip to content

Instantly share code, notes, and snippets.

@vocolboy
Last active April 18, 2016 05:02
Show Gist options
  • Save vocolboy/3aa1a63465d559fcf0c1018c7638e2c7 to your computer and use it in GitHub Desktop.
Save vocolboy/3aa1a63465d559fcf0c1018c7638e2c7 to your computer and use it in GitHub Desktop.
class MeetController extends Controller
{
public function store()
{
$v = Validator::make(request()->all(), Meets::rules());
if($v->fails()) {
#return error
}
#continue
}
}
-------------
class Meets
{
public static function rules()
{
return [
'date_type' => 'required|numeric|in:1,2,3',
'meal_times' => (request('date_type') == 1) ? 'required|numeric|in:1,2,3,4,5' : '',
];
}
}
@vocolboy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment