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