nova-scheduled-jobs
nova-scheduled-jobs copied to clipboard
Job name and description not shown
Hi!
First of all, thanks for your work, I like the tool!
However, I don't seem to get one thing to work: the name of the job and its description are not shown.
protected function schedule(Schedule $schedule)
{
$schedule->call('\App\Console\Job1')->everyMinute();
}
I tried passing the ::class and generating an actual object with 'new' as well: no difference.
The actual job:
namespace App\Console;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class Job1 implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $description = 'Fake job...';
public function __construct()
{
// do s.th.
}
public function __invoke()
{
// do s.th.
}
}
But in the overview of your tool, the job name remains "Closure" and the description is empty.
Any ideas what I'm doing wrong?
As another question: the dispatch button stays greyed out as well. Any ideas?
Thanks in advance! Carsten
namespace
add \Jobs\ folder to namespace
@oleksandr-roskovynskyi Has the right answer for why the dispatch button is greyed out.
For the name and description, Jobs inherit from \Illuminate\Console\Scheduling\CallbackEvent which are essentially closures. The latest version (6.0.0) has better support for this and should have the class name appearing now.