title: Laravel 4 mass assignment guarded not work
body: <p>I wonder what wrong in my code that I can't protected 2 input username and password</p>
  
  <p>In my controller:</p>
  
  <pre><code>class AccountsController extends \BaseController {
  
  ...
  
  public function store()
      {
          $date = new \DateTime;
          $input['updated_at']=$date;
          $input['created_at']=$date;
          $input['username']=Input::get("username", "");
          $input['password']=Input::get("password", "");
          $input['sex']=Input::get("sex", "");
          $input['dob']=Input::get("dob", "");
          $input['dob']= date("Y-m-d", strtotime($input['dob']));
  
          $v=Validator::make($input, Account::$register_rules);
          $input['password']=Hash::make($input['password']);
          if($v-&gt;passes()){
              DB::table('accounts')-&gt;insert($input);
  
          }
          //return Redirect::route('text.index');
      }
  
  ...
  
  }
  </code></pre>
  
  <p>In my model:</p>
  
  <pre><code>class Account extends \Eloquent {
      protected $guarded = array('username', 'password');
  
      public static $register_rules=array(
                  'username'   =&gt; 'required|min:4|max:20|unique:accounts',
                  'password'   =&gt; 'required|alpha_num|min:6',
                  'sex'       =&gt;  'required|in:f,m',
                  'dob'       =&gt; 'required|date_format:Y-m-d'
              );
  }
  </code></pre>
  
  <p>In my app/view</p>
  
  <pre><code>...
  
  
  {{ Form::open(array('route'=&gt;'account.store')) }}
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ Form::label('username', 'Username') }}&lt;/td&gt;
                      &lt;td&gt;{{ Form::text('username') }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ Form::label('password', 'Password') }}&lt;/td&gt;
                      &lt;td&gt;{{ Form::password('password') }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ Form::label('confirm_password', 'Confirm Password') }}&lt;/td&gt;
                      &lt;td&gt;{{ Form::password('confirm_password', array('id'=&gt;'confirm_password')) }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ Form::label('sex', 'Sex') }}&lt;/td&gt;
                      &lt;td&gt;
                          {{ Form::radio('sex', 'f', true) }}{{ Form::label('Female') }}
                          {{ Form::radio('sex', 'm') }}{{ Form::label('Male') }}
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ Form::label('dob', 'Date of Birth') }}&lt;/td&gt;
                      &lt;td&gt;
                          {{Form::text('dob', '', array('id' =&gt; 'dob'))}}
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;{{ Form::submit('Register', array('id' =&gt; 'submit')) }}&lt;/td&gt;
                  &lt;/tr&gt;
  
              &lt;/table&gt;
          {{ Form::close() }}
  
  ...
  </code></pre>
  
  <p>Even though I defined guarded these two fields they are still saved in the database.</p>