laravel subtract date

Solutions on MaxInterview for laravel subtract date by the best coders in the world

showing results for - "laravel subtract date"
Luca
02 May 2017
1$start_time = \Carbon\Carbon::parse($request->input('start_time'));
2$finish_time = \Carbon\Carbon::parse($request->input('finish_time'));
3
4$price = $request->input('price');
5
6$result = $start_time->diffInDays($finish_time, false);
7
8if ($result < 0) {
9  $price = $price * $result;
10}