title: laravel 5 multi form data save in database
body: <p>I use two different forms and connected to database it's working fine. But when I do an insert values stored as two different rows in database.</p>
  
  <p>When do we have to use seeder? Is what I wrote coding proper laravel 5?</p>
  
  <p>Controller file </p>
  
  <pre><code>&lt;?php namespace App\Http\Controllers;
  
  use App\Http\Requests;
  use App\Http\Controllers\Controller;
  use App\Http\Requests\ListFormRequest;
  use App\Http\Requests\LoginFormRequest;
  use Illuminate\Support\Facades\Input;
  
  use Illuminate\Http\Request;
  use Response;
  use App\Test;
  
  class testController extends Controller {
  
    public function test()
    {
      return view('test',array('title' =&gt; 'test'));
    }
  
    public function lockTest(ListFormRequest $test)
    {   $user = new Test();
      $user-&gt;firstname = Input::get('firstname');
      $user-&gt;password = Input::get('password');
      $user-&gt;email = Input::get('email');
  
      $user-&gt;save();
  
      return view('login');
    }
  
    public function login()
    {
      return view('login',array('title' =&gt; 'login'));
    }
  
    public function userLogin(LoginFormRequest $test1)
    {
      $user = new Test();
      $user-&gt;lastname = Input::get('lastname');
      $user-&gt;middlename = Input::get('middlename');
      $user-&gt;save();
  
      return Response::make('Sucessfully Registered!');
    }
  }
  
  Route file
  
  &lt;?php
  
  Route::get('/', 'testController@test');
  Route::post('login', 'testController@lockTest');
  Route::get('login', 'testController@login');
  Route::post('userLogin', 'testController@userLogin');
  
  
  Route::controllers([
    'auth' =&gt; 'Auth\AuthController',
    'password' =&gt; 'Auth\PasswordController',
  ]);
  </code></pre>
  
  <p>Seeder file</p>
  
  <pre><code>   &lt;?php
  
      use Illuminate\Database\Seeder; 
      use Illuminate\Database\Eloquent\Model;
      use App\Test;
  
      class TestsSeeder extends Seeder {
  
        public function run()  {
        DB::table('users')-&gt;truncate();
  
  
        $qwerty = Input::all();
  
        foreach($qwerty as $qwertySingle) {
          Test::create([
              'firstname'  =&gt; $qwertySingle-&gt;firstname,
              'password'   =&gt; $qwertySingle-&gt;password,
              'email'      =&gt; $qwertySingle-&gt;email,
              'lastname'   =&gt; $qwertySingle-&gt;lastname,
              'middlename' =&gt; $qwertySingle-&gt;middlename,
          ]);
        } 
  
       DB::table('tests')-&gt;insert($qwerty);
  
       }
     }
  </code></pre>
  
  <p>Model file</p>
  
  <pre><code>&lt;?php namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  use App\DB;
  
  class Test extends Model {
  
    protected $guarded = array();
    protected $table = 'tests';
  
    protected $fillable = ['firstname', 'password', 'email', 'lastname', 'middlename'];
  }
  </code></pre>