title: Laravel save method taking wrong table name
body: <p>Hi all i am trying to create a campaign. In the process of campaign i will assign certain products to that campaign. So i have to insert details after post campaign creation into two tables one is <code>campaigns</code> and another one is <code>campaignsproducts</code>. So i created two models for each of them on the same names. </p>
  
  <p>I am trying to insert records into both tables on post action using save method. I am able to insert into <code>campaigns</code> but when it comes to <code>campaignsproducts</code> it says <code>campaigns_products</code> table not exists.</p>
  
  <p>In my db my table name was <code>CampaignsProducts</code>. Please help where i am going wrong. Please find my migration, model and post action code below.</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCamapignproductsTable extends Migration {
  
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('campaignproducts', function(Blueprint $table)
          {
              $table-&gt;increments('id');
  
              $table-&gt;integer('campaign_id')-&gt;unsigned();
              $table-&gt;integer('product_id')-&gt;unsigned();
              $table-&gt;decimal('product_sell_cost', 10, 2);
  
              $table-&gt;timestamps();
          });
  
          Schema::table('campaignproducts', function($table) {
              $table-&gt;foreign('campaign_id')-&gt;references('id')-&gt;on('campaigns');
              $table-&gt;foreign('product_id')-&gt;references('id')-&gt;on('products');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('campaignproducts');
      }
  
  }
  </code></pre>
  
  <p>Model CampaignProducts.php</p>
  
  <pre><code>&lt;?php
  
  class CampaignProducts extends Eloquent {
  
      public function camapigns(){
          return $this-&gt;hasMany('Campaign');
      }
  
      public function products(){
          return $this-&gt;hasMany('Product');
      }
  }
  </code></pre>
  
  <p>Post action in controller</p>
  
  <pre><code>public function postCampaign()
  {
      //validation rules for create product 
      $rules = array(
          'campaign_name'         =&gt; 'required|min:2',
          'campaign_description'  =&gt; 'required|min:2',
          'campaign_startdate'    =&gt; 'required|date_format:"Y-m-d"',
          'campaign_enddate'      =&gt; 'required|date_format:"Y-m-d"',
          'campaign_urlname'      =&gt; 'required|between:4,20',
          'campaign_target'       =&gt; 'required|integer|min:1',
          'user_id'               =&gt; 'required|integer|min:1'
      );
  
      $validator = Validator::make(Input::all(), $rules);
  
      //procee the validation rules
      if($validator-&gt;fails()) {
          return Redirect::to('products/newcampaign')
              -&gt;withErrors($validator)
              -&gt;withInput();
      } else {
          echo "&lt;pre&gt;";
          print_r(Input::all());
  
          //store category data
          $campaign = new Campaign;
          $campaign-&gt;campaign_name            = Input::get('campaign_name');
          $campaign-&gt;campaign_description     = Input::get('campaign_description');
          $campaign-&gt;campaign_startdate       = Input::get('campaign_startdate');
          $campaign-&gt;campaign_enddate         = Input::get('campaign_enddate');
          $campaign-&gt;campaign_urlname         = Input::get('campaign_urlname');
          $campaign-&gt;campaign_target      = Input::get('campaign_target');
          $campaign-&gt;user_id              = Input::get('user_id');
  
          $campaign_id = $campaign-&gt;save();
          $campaign_products = Input::get('productid');
  
          $campaignproducts = new CampaignProducts;
          foreach($campaign_products as $key =&gt; $id)
          {
              $campaignproducts-&gt;product_id       = $key;
              $$campaignproducts-&gt;product_sell_cost = $id;
              $campaignproducts-&gt;campaign_id =    $campaign_id;
              $campaignproducts-&gt;save();  
          }       
  
          //redirect
          Session::flash('message', 'Successfully created campaign!');
          return Redirect::to('campaigns');
      }
  }
  </code></pre>