Estado inicial: frontend React + backend Laravel

This commit is contained in:
Xavier Oliveira
2026-05-15 15:57:54 +01:00
commit 41c5f87d5b
216 changed files with 29916 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Console\Commands;
use App\Models\Workshop;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class UpdateWorkshopStatus extends Command
{
protected $signature = 'workshops:update-status';
protected $description = 'Atualiza o estado de workshops agendados para realizados se a data for menor que a data atual';
public function handle()
{
$update = Workshop::where(function($query){
$query->where('date', '<', now()->toDateString())
->orWhere(function($q){
$q->where('date', '=', now()->toDateString())
->where('time_end', '<', now()->toTimeString());
});
})
->where('status', 'pending')
->update(['status' => 'realized']);
$this->info('Workshops atualizados com sucesso');
}
}