Skip to content

Commit 18b9035

Browse files
authored
Merge pull request #1 from saulens22/master
Get table name from config file
2 parents 46b2172 + 3f1faa6 commit 18b9035

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Repat/LaravelJobs/Job.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Repat\LaravelJobs;
44

5+
use Illuminate\Support\Facades\Config;
6+
57
class Job extends \Illuminate\Database\Eloquent\Model
68
{
79
use Attributes;
@@ -14,4 +16,10 @@ class Job extends \Illuminate\Database\Eloquent\Model
1416
'available_at' => 'datetime',
1517
'created_at' => 'datetime',
1618
];
19+
20+
public function __construct()
21+
{
22+
parent::__construct();
23+
$this->table = Config::get('queue.connections.' . (Config::get('queue.default', 'database')) . '.table', 'jobs');
24+
}
1725
}

src/Repat/LaravelJobs/JobFail.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Repat\LaravelJobs;
44

5+
use Illuminate\Support\Facades\Config;
6+
57
class JobFail extends \Illuminate\Database\Eloquent\Model
68
{
79
use Attributes;
@@ -12,4 +14,10 @@ class JobFail extends \Illuminate\Database\Eloquent\Model
1214
'payload' => 'array',
1315
'failed_at' => 'datetime',
1416
];
17+
18+
public function __construct()
19+
{
20+
parent::__construct();
21+
$this->table = Config::get('queue.failed.table', 'job_fails');
22+
}
1523
}

0 commit comments

Comments
 (0)