Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduling not work at admin panel #21

Open
Oliwer-Budnik opened this issue Oct 24, 2024 · 0 comments
Open

Scheduling not work at admin panel #21

Oliwer-Budnik opened this issue Oct 24, 2024 · 0 comments

Comments

@Oliwer-Budnik
Copy link

<?php

namespace App\Console;

use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Console\Scheduling\Schedule;
use OpenAdmin\Admin\Scheduling\CronSchedule;
use OpenAdmin\Admin\Scheduling\Scheduling;

class Kernel extends ConsoleKernel
{
    protected function schedule(Schedule $schedule): void
    {
        $schedule->command('inspire')->everyTenMinutes();
//        $schedule->runTask(1);

        $schedule->command('route:list')->everyTenMinutes();
    }
}

This code not work, and task is not shown at schedule view. At Documentation noone said nothing about imports, and what to do with this code. Maybe some bootstrap.php code missing, but I have not info what to do.

Command php artisan schedule:run shows schedulings, but not at admin panel:
image

Do not shows schedulings from project/app/Console/Kernel.php, but from project/routes/console.php:

<?php

//    use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Console\Scheduling\Schedule as CronSchedule;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly();

Schedule::command('inspire')->everyFiveSeconds();

Those schedulings is shown by php artisan schedule:run or list. But those commads are not visible at admin panel, like at documentation of this extension.

Saddly documentation not show what to import to class Kernel. Maybe wrong location? Or maybe docker makes, that I have to put this class at another localization?

Ps. I have added to routes/console.php class Kernel like above, but this is not work too.

Ps It is OpenAdmin, but this is only a fork from your extension. Works the same, but not works at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant