title: How to override vendor method in laravel 5.7?
body: <p>I try to override method of vendor class:</p>
  
  <pre><code>namespace App\Providers\Rewritten;
  
  use Illuminate\Queue\DatabaseQueue;
  
  class MyDatabaseQueue extends DatabaseQueue
  {
  
      protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0)
      {
          //my code here
      }
  }
  </code></pre>
  
  <p>And i try to register alias in AppServiceProvider like this:</p>
  
  <pre><code>$loader = AliasLoader::getInstance();
  
  $loader-&gt;alias(
              'Illuminate\Queue\DatabaseQueue',
              'App\Providers\Rewritten\MyDatabaseQueue'
          );
  </code></pre>
  
  <p>And then i have error myssage:</p>
  
  <pre><code>Class 'Illuminate\Queue\DatabaseQueue' not found
  </code></pre>
  
  <p>But why? I don't understand.
  Can sombody help with that?</p>