ispt4.0_laravel/app/Console/Kernel.php
2024-02-12 17:47:22 +00:00

32 lines
796 B
PHP
Executable File

<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
$schedule->call(function () {
\App\Models\CompanyProject::where('order_project', 2)
->where('date_started', '<=', now())
->update(['order_project' => 3]);
})->everyMinute(); // Ou ajuste para a frequência desejada
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}