feat: complete flightShow and comments flight

This commit is contained in:
2026-08-17 14:09:39 -07:00
parent ff50fe1a95
commit c4692d8d8d
3 changed files with 22 additions and 3 deletions
@@ -5,7 +5,6 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginPostRequest;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
+21 -1
View File
@@ -2,6 +2,9 @@
namespace App\Http\Controllers;
use App\Models\Airport;
use App\Models\Flight;
use App\Models\Tour;
use Illuminate\Http\Request;
class IndexController extends Controller
@@ -9,6 +12,23 @@ class IndexController extends Controller
public function index()
{
return view('index');
$flights = Flight::query()
->with([
'airport.city',
'airline',
'file'
])
->orderByDesc('created_at')
->limit(10)
->paginate();
$tours = Tour::query()
->orderByDesc('created_at')
->limit(10)
->paginate();
return view('index', compact('tours','flights'));
}
}
@@ -93,7 +93,7 @@ class RegisterPostRequest extends FormRequest
'nullable',
'image',
'mimes:jpg,png,webp',
'max:255'
'max:800'
]
];
}