mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/tickme.git
synced 2026-08-19 20:43:58 +00:00
26 lines
698 B
PHP
26 lines
698 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Tasks;
|
|
|
|
|
|
use App\Classes\ValueObjects\Constants\HttpStatus;
|
|
use App\Classes\ValueObjects\Response\ApiResponseObject;
|
|
use App\Models\ProjectMilestone;
|
|
use App\Models\Task;
|
|
use App\Models\TimeTracker;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class TaskOrderController
|
|
{
|
|
|
|
public function start(int $taskId){
|
|
$task = Task::find($taskId);
|
|
$task->trackers()->attach(Auth::user()->getAuthIdentifier(), ['time_start' => Carbon::now()]);
|
|
|
|
return (new ApiResponseObject('Timer Started Successfully',
|
|
'You have successfully started the task timer',
|
|
HttpStatus::OK_WITH_MESSAGE, []))->handler();
|
|
}
|
|
|
|
} |