add test
This commit is contained in:
@@ -53,7 +53,7 @@ class TimeTrackerController extends Controller
|
||||
*/
|
||||
public function show(TimeTracker $timeTracker)
|
||||
{
|
||||
//
|
||||
return response()->json(new TimeTrackerResource($timeTracker->load('toDo')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,7 @@ class ToDoResource extends JsonResource
|
||||
'user_id' => $this->user_id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'checked' => $this->checked,
|
||||
'checked' => $this->checked?->format('Y-m-d H:i:s'),
|
||||
'duration' => $this->duration,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ class ToDo extends Model
|
||||
'description',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'checked' => 'datetime',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
||||
Reference in New Issue
Block a user