title: Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()
body: <p>Firstly i was getting an error in</p>
  
  <pre><code>php artisan migrate
  </code></pre>
  
  <p>as </p>
  
  <p><code>SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes</code></p>
  
  <p>and Then i found a post on <code>laracasts</code> to fix this as</p>
  
  <pre><code>use Illuminate\Support\Facades\Schema;
  
  public function boot()
  {
      Schema::defaultStringLength(191);
  }
  </code></pre>
  
  <p>After adding this, when i run </p>
  
  <pre><code>php artisan optimize
  </code></pre>
  
  <p>then i am presented with new error as below</p>
  
  <p><code>Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()</code></p>
  
  <p>Please assist in getting rid of all these errors.</p>