Skip to content

Commit

Permalink
add the scheduler for trasks
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Sep 10, 2024
1 parent 74961b2 commit 640ee9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@

\Illuminate\Support\Facades\Schedule::command('app:check_email')
->everyMinute();



\Illuminate\Support\Facades\Schedule::call(function () {
(new \App\Domains\Projects\DailyReportService())->handle();
})->dailyAt('05:00');
10 changes: 10 additions & 0 deletions tests/Feature/Models/ProjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ public function test_model(): void
$this->assertNotNull($model->team->id);
$this->assertNotNull($model->tasks->first()->id);
}

public function test_active() {
$model = Project::factory()->create([
'start_date' => now()->subDays(5),
'end_date' => now()->subDays(2),
]);

$this->assertEmpty(Project::active()->get());
}

}

0 comments on commit 640ee9e

Please sign in to comment.