<?php

use App\Http\Controllers\ContactController;
use App\Http\Controllers\ImagesController;
use App\Models\Blog;
use App\Models\Faq;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
})->name('Home');

Route::get('/blog', function () {
    return view('pages.blog', [
        'blogs' => Blog::active()->get(),
    ]);
})->name('Blog');

Route::get('/blog/{blog}', function (Blog $blog) {
    return view('pages.blog-post', ['blog' => $blog]);
})->name('Blog.post');

Route::get('/faqs', function () {
    return view('pages.faqs', [
        'faqs' => Faq::active()->get(),
    ]);
})->name('FAQs');

Route::get('/contact-us', function () {
    return view('pages.contact');
})->name('Contact us');

Route::get('/price', function () {
    return view('pages.pricing');
})->name('Pricing');

Route::get('/classes', function () {
    return view('pages.timetable');
})->name('Classes');

Route::controller(ImagesController::class)->group(function () {
    Route::get('images/{file}', 'show')->name('Images.show');
    Route::get('images/{directory}/{file}', 'subDirectory')->name('Images.subDirectory');
});

route::controller(ContactController::class)->group(function () {
    route::post('contact', 'email')->name('contact.submit');
    route::post('book-trial', 'trial')->name('contact.trial');
});
