1

Laravel 5.6

In my project there is a table named "jobs" and Model named "Job".

Now i want to use Laravel Queues, But migration will make job table and model which i have already taken.

So how to tackle this situation? Somebody help! Thanks in advance.!

Tridev Shrestha
  • 447
  • 7
  • 21
ImZedi
  • 294
  • 4
  • 15
  • 2
    Possible duplicate of [customising Job and job table in Laravel queue/ rename jobs table](https://stackoverflow.com/questions/41294337/customising-job-and-job-table-in-laravel-queue-rename-jobs-table) – Clément Baconnier Feb 22 '19 at 16:10

1 Answers1

4

1) Run php artisan queue:table

2) Update the table name to a new name in the created migration and run migration using php artisan migrate

3) You can edit the job table name inside config/queue.php :

'connections' => [
    ...
    'database' => [
        'driver' => 'database',
        'table' => 'your_jobs_table',
        'queue' => 'default',
        'expire' => 60,
    ],
]
Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
Mihir Bhende
  • 8,677
  • 1
  • 30
  • 37
  • Thanks i got it but jst one more query that by using different job table name will work queue? – ImZedi Feb 22 '19 at 16:54
  • 1
    Yes, once you specify the connection in queue config file, laravel will pick the table you specify as the queue management table. So it will work definitely. Just make sure you do `php artisan config:clear` to flush out configuration cache – Mihir Bhende Feb 22 '19 at 16:55