Skip to content

Commit

Permalink
fix: add task complete notification
Browse files Browse the repository at this point in the history
  • Loading branch information
hekmatinasser committed Feb 23, 2024
1 parent 4381a45 commit e42bbbd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Repositories/Task/TaskRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Repositories\Task;

use App\Models\Task;
use App\Notifications\TaskComplete;
use Celysium\Base\Repository\BaseRepository;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
Expand Down Expand Up @@ -30,8 +31,11 @@ public function complete(Task $task): Task
{
$task->completed_at = now();
$task->save();
$task->refresh();

return $task->refresh();
$task->user->notify(new TaskComplete($task));

return $task;
}

public function autoComplete(int $deadline): void
Expand Down

0 comments on commit e42bbbd

Please sign in to comment.