To set the queue name using an enum in Laravel, you need to ensure that you're using the string value of the enum case, not the enum case itself. In your code, you're directly assigning the enum case to the $queue property, which is likely expecting a string. You can access the string value of an enum case by using the ->value property.
Here's how you can modify your constructor to set the queue name correctly:
public function __construct() {
$this->queue = Queue::Low->value;
}
In this code, Queue::Low->value will return the string 'low', which can be used to set the queue name for a job.
Make sure your job class is set up to accept a queue name as a string, and this should resolve the error you're encountering. Enums are supported in PHP 8.1 and later, so ensure your environment is using a compatible PHP version.