Add (initial): futurewalker code
This commit is contained in:
@@ -14,14 +14,16 @@ class PublishIndexPostJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $post;
|
||||
protected $post_id;
|
||||
|
||||
public $timeout = 10;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(Post $post)
|
||||
public function __construct(int $post_id)
|
||||
{
|
||||
$this->post = $post;
|
||||
$this->post_id = $post_id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,8 +31,6 @@ public function __construct(Post $post)
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
if (! is_null($this->post)) {
|
||||
PublishIndexPostTask::handle($this->post);
|
||||
}
|
||||
PublishIndexPostTask::handle($this->post_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user