30 lines
974 B
PHP
30 lines
974 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Tour;
|
|
use Illuminate\Http\Request;
|
|
|
|
class TourController extends Controller
|
|
{
|
|
public function show(Tour $tour)
|
|
{
|
|
$tour->load([
|
|
'tour_details',
|
|
'originAirport',
|
|
'destinationAirport',
|
|
'file',
|
|
]);
|
|
|
|
$startTime = verta($tour->tour_details->first()?->start_date)->format('d-%B');
|
|
$endTime = verta($tour->tour_details->first()?->end_date)->format('d-%B');
|
|
|
|
|
|
$startTravel = verta($tour->tour_details->first()?->start_date)->format('Y-m-d');
|
|
$endTravel = verta($tour->tour_details->first()?->end_date)->format('Y-m-d');
|
|
$startDay = verta($tour->tour_details->first()?->start_date)->format('%A');
|
|
$endDay = verta($tour->tour_details->first()?->end_date)->format('%A');
|
|
return view('tours.show', compact('tour' , 'startTime' , 'endTime' , 'startTravel' , 'endTravel' , 'startDay' , 'endDay'));
|
|
}
|
|
}
|