JobConnectionPropertyToJobConnectionAttributeRector

Changes the connection property to use the Connection attribute on queue jobs

 use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Queue\Attributes\Connection;

+#[Connection('redis')]
 final class ProcessPodcast implements ShouldQueue
 {
-    public $connection = 'redis';
 }

Configure your rector.php:

<?php

use RectorLaravel\Rector\Class_\JobConnectionPropertyToJobConnectionAttributeRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withRules([
        JobConnectionPropertyToJobConnectionAttributeRector::class,
    ]);