Files
rkm-conectasus-ci-sandbox/api/app/Http/Controllers/Geral/DiferencaTempoController.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

22 lines
474 B
PHP

<?php
namespace App\Http\Controllers\Geral;
use App\Http\Controllers\Controller;
use App\Services\Geral\AgeService;
use Carbon\Carbon;
class DiferencaTempoController extends Controller
{
public function calc($year, $month, $day)
{
$diff = AgeService::getAge(Carbon::create($year, $month, $day)->toDateTime());
return [
'anos' => $diff->years,
'meses' => $diff->months,
'dias' => $diff->days
];
}
}