Validating multiple checkboxes laravel 5.2
<p>I am trying to validate checkboxes in my Laravel application. The HTML name and values of the checkbox are generated from my database and I am doing a loop to display all the boxes. How do I do a validation rule so that at least one box is checked or required? These are the relevant view code from my blade file and the method from my controller.</p>

<pre><code>//Snippet from create-user.blade.php
&lt;div class='form-group'&gt;
    @foreach ($roles as $role) //$role variable gets its data from the db
    {{ Form::label('role', $role-&gt;display_name) }}
    {{ Form::checkbox($role-&gt;name, $role-&gt;id) }}
    @endforeach
&lt;/div&gt;

//Snippet from UserController.php
public function addUser(Request $request)
{

    $this-&gt;validate($request, [
        'name'=&gt;'required|max:120|alpha_dash',
        'email'=&gt;'required|email|unique:users',
        $role-&gt;name =&gt;'required', //This line results in 'Undefined variable: role'
        'password'=&gt;'required|min:4',
        'password_confirmation'=&gt;'required|min:4']
    );
    $email = $request['email'];
    $name = $request['name'];
    $password = bcrypt($request['password']);
    $user = new User();
    $user-&gt;email = $email;
    $user-&gt;name = $name;
    $user-&gt;password = $password;
    $user-&gt;save();

    return redirect()-&gt;route('account');
}
</code></pre>

<p>What do I pass in place of <code>$role-&gt;name</code> in the validation array?
Thanks</p>