title: Post method fail with Vue.js "500 (Internal Server Error)"
body: <p>So I'm trying to store data in my election_users table but making a POST request gives a "500 (Internal Server Error)" error. My object does return the right "election_id". I don't know what I'm doing wrong.</p>
  
  <p>here's my method in my vue script:</p>
  
  <pre><code>methods: {
        createVote: function () {
          var itemId = this.$route.params.id
          var input = this.newUserVoted
          this.newUserVoted.election_id = itemId
          this.$http.post('http://www.nmdad2-05-elector.local/api/v1/electionuser', input)
            .then((response) =&gt; {
              this.newUserVoted = {'election_id': itemId}
            }).catch(e =&gt; {
              console.log(e)
              console.log(input)
            })
        }
      },
  </code></pre>
  
  <p>my UsersController.php</p>
  
  <pre><code>public function store(Request $request)
      {
  
          $userVoted = new ElectionUser();
          $userVoted-&gt;election_id = $request['election_id'];
          $userVoted-&gt;user_id = Auth::id();
  
          if ($userVoted-&gt;save()) {
  
  
              return response()
                  -&gt;json($userVoted);
  
          }
  
      }
  </code></pre>
  
  <p>my routesApi.php</p>
  
  <pre><code>   Route::post( 'electionuser', 'UsersController@store' );
  </code></pre>
  
  <p>My ElectionUser.php</p>
  
  <pre><code>class ElectionUser extends Model
  {
      // Relationships
      // =============
  
      protected $fillable = [
          'election_id',
          'user_id'
      ];
  
      public function election()
      {
          return $this-&gt;belongsToMany(Election::class);
      }
  </code></pre>
  
  <p>}</p>