title: Cartalyst Sentinel Laravel - How do you create roles?
body: <p>Im new to Cartalyst Sentinel and this concept of ACL. I've managed to create a user, perform activation and login and logout.</p>
  
  <p>I'd like to take my learning to the next level. I would like 2 types of Users on this laravel app. 1 is Administrator another is Subscriber. I'm assuming my account creation method should by default create the user a subscriber. </p>
  
  <pre><code>public function postCreate() {
  
          /* Validation */
          $validation = Validator::make(Input::all(), [
              'email' =&gt; 'required|email|max:50|unique:users',
              'username' =&gt; 'required|min:3|max:20|unique:users',
              'password' =&gt; 'required|min:6',
              'password_repeat' =&gt; 'required|same:password',
          ]);
  
          if ($validation-&gt;fails()) {
  
              return Redirect('login')-&gt;withErrors($validation)-&gt;withInput();
  
          } else {
  
              $credentials = Input::all();
              $user = Sentinel::register($credentials);
  
              $activation = Activation::create($user);
  
              $activation_code = $activation-&gt;code;
  
              if ($user) {
  
                  Mail::send('emails.auth.activate', ['link' =&gt; URL::route('account-activate', [$user-&gt;id, $activation_code]), 'username' =&gt; $user-&gt;username], function($message) use ($user) {
  
                      $message-&gt;to($user-&gt;email, $user-&gt;username)-&gt;subject('Activate your account');
  
                  });
  
                  return Redirect::route('home')-&gt;with('global', 'Thank you for registering! We have sent you an email to activate your account');
  
              }
  
          }       
  
      }
  </code></pre>
  
  <p>Do i alter the code like so</p>
  
  <pre><code>$user = Sentinel::register($credentials);
  
  $user = Sentinel::findById(1);
  
  $role = Sentinel::findRoleByName('Subscribers');
  
  $role-&gt;users()-&gt;attach($user);
  </code></pre>
  
  <p>The thing is i have not even created any roles to begin with. Where do we write that functionality? Right now i have the following Controllers</p>
  
  <ol>
  <li>AccountController - handles activation</li>
  <li>AuthController - handles login/logout</li>
  <li>RegistrationController - handles registration of user</li>
  <li>RolesController - i've not written anything inside here yet. Im a bit lost.</li>
  </ol>
  
  <p>Please guide me. Any help is greatly appreciated.</p>