title: Benefit Of Migrations in Laravel
body: <p>as In laravel we Use Migrations to Create Tables and then Seeders to seed out table, am not getting its benefit, as we can do that in normal way by just going to PHPMYADMIN then what we need to that, as we code many lines for it, but how can we justify those lines of code ? </p>
  
  <pre><code>use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateItemsTable extends Migration {
  
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('items', function(Blueprint $table)
          {
              $table-&gt;increments('id');
              $table-&gt;integer('owner_id');
              $table-&gt;string('name');
              $table-&gt;boolean('done');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('items');
      }
  
  }
  </code></pre>
  
  <p>it is true that migrations are being created by php artisan commands, But what is the benefit of them? as we have an alternate to do that? 
  same for the Seeder files as we code many lines for it</p>
  
  <pre><code>class ItemTableSeeder extends Seeder{
  
      public function run(){
          DB::table('items')-&gt;delete();
      $items= array(
          array(
              'owner_id' =&gt; '1',
              'name' =&gt; 'Watch The Spectacular Now',
              'done' =&gt; True
              ),
          array(
              'owner_id' =&gt; '2',
              'name' =&gt; 'Watch Avengers',
              'done' =&gt; False
              ),
          array(
              'owner_id' =&gt; '1',
              'name' =&gt; 'Watch The Iron man',
              'done' =&gt; False
              ),
          array(
              'owner_id' =&gt; '1',
              'name' =&gt; 'Divergent',
              'done' =&gt; False
              ),
          array(
              'owner_id' =&gt; '1',
              'name' =&gt; 'Bat Man',
              'done' =&gt; False
              ),
          array(
              'owner_id' =&gt; '1',
              'name' =&gt; 'X-Men Days Of Future Past',
              'done' =&gt; False
              )
          );
      DB::table('items')-&gt;insert($items);
  
      }
  
  }
  </code></pre>