This commit is contained in:
21
api/app/Http/Controllers/Geral/DiferencaTempoController.php
Normal file
21
api/app/Http/Controllers/Geral/DiferencaTempoController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user