Reputation: 1019
To set Laravel job's $timeout
value we can use this code
public $timeout = 120;
Is there a way to set this value dynamically (via a method)? something like this
public function timeout(): int
{
return config('general.some_config');
}
The above code does not seem to have any effect on the job's timeout value.
Upvotes: 0
Views: 410
Reputation: 51
You can assign it by constructor in like this
public function __construct()
{
$this->timeout = config('general.some_config');
}
Upvotes: 1