Skip to content

Commit

Permalink
fix: task repository
Browse files Browse the repository at this point in the history
  • Loading branch information
hekmatinasser committed Feb 22, 2024
1 parent c915a87 commit 3df10f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Repositories/Task/TaskRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

class TaskRepository extends BaseRepository implements TaskRepositoryInterface
{
public function __construct(Task $task)
{
parent::__construct($task);
}

public function query(Builder $query, array $parameters): Builder
{
Expand All @@ -19,14 +23,14 @@ public function store(array $parameters): Model
{
$parameters['user_id'] = auth()->id();

return parent::store($parameters);
return parent::store($parameters)->refresh();
}

public function complete(Task $task): Task
{
$task->completed_at = now();
$task->save();

return $task;
return $task->refresh();
}
}

0 comments on commit 3df10f5

Please sign in to comment.