<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/console-clear', function () {
    Artisan::call('config:clear');
    Artisan::call('config:cache');
    Artisan::call('cache:clear');
    Artisan::call('route:clear');
    Artisan::call('view:clear');
});


Route::get('/', 'Frontend\HomePageController@homepage')->name('frontend.home.index');
Route::get('/about-canvas', 'Frontend\HomePageController@about')->name('frontend.about');
Route::get('/board-of-directors', 'Frontend\HomePageController@directors')->name('frontend.director');
Route::get('/management-teams', 'Frontend\HomePageController@teams')->name('frontend.team');
Route::get('/principal-message', 'Frontend\HomePageController@message')->name('frontend.message');
Route::get('/faculty-members', 'Frontend\HomePageController@members')->name('frontend.member');
Route::get('/whyCanvas', 'Frontend\HomePageController@whyCanvas')->name('frontend.whyCanvas');
Route::get('/academic-program/{slug}', 'Frontend\HomePageController@program')->name('frontend.program');
Route::get('/course-details/{slug}', 'Frontend\HomePageController@course')->name('frontend.course');
Route::get('/student-speak', 'Frontend\HomePageController@testimonial')->name('frontend.student.speak');
Route::get('/alumnae', 'Frontend\HomePageController@alumni')->name('frontend.alumni');
Route::get('/canvas-lifes', 'Frontend\HomePageController@canvasLife')->name('frontend.canvasLife');
Route::get('/notices', 'Frontend\HomePageController@notice')->name('frontend.notice');
Route::get('/notice-details/{slug}', 'Frontend\HomePageController@noticeDetails')->name('frontend.noticeDetails');
Route::get('/events', 'Frontend\HomePageController@event')->name('frontend.event');
Route::get('/event-details/{slug}', 'Frontend\HomePageController@eventDetails')->name('frontend.eventDetails');
Route::get('/image-gallery', 'Frontend\HomePageController@image')->name('frontend.image.gallery');
Route::get('/video-gallery', 'Frontend\HomePageController@video')->name('frontend.video.gallery');
Route::get('/scholarships', 'Frontend\HomePageController@scholarship')->name('frontend.scholarship');
Route::get('/syllabi', 'Frontend\HomePageController@syllabus')->name('frontend.syllabi');
Route::get('/college-hour', 'Frontend\HomePageController@hour')->name('frontend.hour');
Route::get('contact-us', 'Frontend\HomePageController@contactUs')->name('frontend.contact');
Route::post('contact-us/store', 'Frontend\HomePageController@contactUsStore')->name('frontend.contact.store')
    ->middleware('throttle:2,1');

Route::get('/@dashboard@', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('/@dashboard@', 'Auth\LoginController@login')->middleware('throttle:2,1');
Route::post('/logout', 'Auth\LoginController@logout')->name('logout')->middleware('throttle:2,1');
Route::get('/register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('/register', 'Auth\RegisterController@register')->middleware('throttle:2,1');
Route::get('/password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email')->middleware('throttle:2,1');
Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('/password/reset', 'Auth\ResetPasswordController@reset')->name('password.update')->middleware('throttle:2,1');


Route::namespace('Backend')->middleware('auth')->group(function () {
    Route::get('/home', 'dashboardController@index')->name('home');

    //Popup Routes
    Route::get('popup/create', 'PopupController@create')->name('backend.popup.create');
    Route::post('popup/store', 'PopupController@store')->name('backend.popup.store');
    Route::get('popup', 'PopupController@index')->name('backend.popup.index');
    Route::get('popup/{id}/edit', 'PopupController@edit')->name('backend.popup.edit');
    Route::put('popup/{id}/update', 'PopupController@update')->name('backend.popup.update');
    Route::delete('popup/{id}/delete', 'PopupController@destroy')->name('backend.popup.destroy');
    Route::get('popup/{id}/show', 'PopupController@show')->name('backend.popup.show');

    //Slider Routes
    Route::get('slider/create', 'SliderController@create')->name('backend.slider.create');
    Route::post('slider/store', 'SliderController@store')->name('backend.slider.store');
    Route::get('slider', 'SliderController@index')->name('backend.slider.index');
    Route::get('slider/{id}/edit', 'SliderController@edit')->name('backend.slider.edit');
    Route::put('slider/{id}/update', 'SliderController@update')->name('backend.slider.update');
    Route::delete('slider/{id}/delete', 'SliderController@destroy')->name('backend.slider.destroy');
    Route::get('slider/{id}/show', 'SliderController@show')->name('backend.slider.show');

    //About Routes
    Route::get('about/create', 'AboutController@create')->name('backend.about.create');
    Route::post('about/store', 'AboutController@store')->name('backend.about.store');
    Route::get('about', 'AboutController@index')->name('backend.about.index');
    Route::get('about/{id}/edit', 'AboutController@edit')->name('backend.about.edit');
    Route::put('about/{id}/update', 'AboutController@update')->name('backend.about.update');
    Route::delete('about/{id}/delete', 'AboutController@destroy')->name('backend.about.destroy');
    Route::get('about/{id}/show', 'AboutController@show')->name('backend.about.show');

    //Board Of Director Routes
    Route::get('director/create', 'DirectorController@create')->name('backend.director.create');
    Route::post('director/store', 'DirectorController@store')->name('backend.director.store');
    Route::get('director', 'DirectorController@index')->name('backend.director.index');
    Route::get('director/{id}/edit', 'DirectorController@edit')->name('backend.director.edit');
    Route::put('director/{id}/update', 'DirectorController@update')->name('backend.director.update');
    Route::delete('director/{id}/delete', 'DirectorController@destroy')->name('backend.director.destroy');
    Route::get('director/{id}/show', 'DirectorController@show')->name('backend.director.show');

    //Management Team Routes
    Route::get('team/create', 'TeamController@create')->name('backend.team.create');
    Route::post('team/store', 'TeamController@store')->name('backend.team.store');
    Route::get('team', 'TeamController@index')->name('backend.team.index');
    Route::get('team/{id}/edit', 'TeamController@edit')->name('backend.team.edit');
    Route::put('team/{id}/update', 'TeamController@update')->name('backend.team.update');
    Route::delete('team/{id}/delete', 'TeamController@destroy')->name('backend.team.destroy');
    Route::get('team/{id}/show', 'TeamController@show')->name('backend.team.show');

    //Principal Message Routes
    Route::get('message/create', 'MessageController@create')->name('backend.message.create');
    Route::post('message/store', 'MessageController@store')->name('backend.message.store');
    Route::get('message', 'MessageController@index')->name('backend.message.index');
    Route::get('message/{id}/edit', 'MessageController@edit')->name('backend.message.edit');
    Route::put('message/{id}/update', 'MessageController@update')->name('backend.message.update');
    Route::delete('message/{id}/delete', 'MessageController@destroy')->name('backend.message.destroy');
    Route::get('message/{id}/show', 'MessageController@show')->name('backend.message.show');

    //Faculty Members Routes
    Route::get('member/create', 'MemberController@create')->name('backend.member.create');
    Route::post('member/store', 'MemberController@store')->name('backend.member.store');
    Route::get('member', 'MemberController@index')->name('backend.member.index');
    Route::get('member/{id}/edit', 'MemberController@edit')->name('backend.member.edit');
    Route::put('member/{id}/update', 'MemberController@update')->name('backend.member.update');
    Route::delete('member/{id}/delete', 'MemberController@destroy')->name('backend.member.destroy');
    Route::get('member/{id}/show', 'MemberController@show')->name('backend.member.show');

    //Faculty Members Routes
    Route::get('why-canvas/create', 'CanvasController@create')->name('backend.canvas.create');
    Route::post('why-canvas/store', 'CanvasController@store')->name('backend.canvas.store');
    Route::get('why-canvas', 'CanvasController@index')->name('backend.canvas.index');
    Route::get('why-canvas/{id}/edit', 'CanvasController@edit')->name('backend.canvas.edit');
    Route::put('why-canvas/{id}/update', 'CanvasController@update')->name('backend.canvas.update');
    Route::delete('why-canvas/{id}/delete', 'CanvasController@destroy')->name('backend.canvas.destroy');
    Route::get('why-canvas/{id}/show', 'CanvasController@show')->name('backend.canvas.show');

    //Academic Programs Routes
    Route::get('program/create', 'ProgramController@create')->name('backend.program.create');
    Route::post('program/store', 'ProgramController@store')->name('backend.program.store');
    Route::get('program', 'ProgramController@index')->name('backend.program.index');
    Route::get('program/{id}/edit', 'ProgramController@edit')->name('backend.program.edit');
    Route::put('program/{id}/update', 'ProgramController@update')->name('backend.program.update');
    Route::delete('program/{id}/delete', 'ProgramController@destroy')->name('backend.program.destroy');
    Route::get('program/{id}/show', 'ProgramController@show')->name('backend.program.show');

    //Courses Routes
    Route::get('course/create', 'CourseController@create')->name('backend.course.create');
    Route::post('course/store', 'CourseController@store')->name('backend.course.store');
    Route::get('course', 'CourseController@index')->name('backend.course.index');
    Route::get('course/{id}/edit', 'CourseController@edit')->name('backend.course.edit');
    Route::put('course/{id}/update', 'CourseController@update')->name('backend.course.update');
    Route::delete('course/{id}/delete', 'CourseController@destroy')->name('backend.course.destroy');
    Route::get('course/{id}/show', 'CourseController@show')->name('backend.course.show');

    //Alumni Routes
    Route::get('testimonial/create', 'TestimonialController@create')->name('backend.testimonial.create');
    Route::post('testimonial/store', 'TestimonialController@store')->name('backend.testimonial.store');
    Route::get('testimonial', 'TestimonialController@index')->name('backend.testimonial.index');
    Route::get('testimonial/{id}/edit', 'TestimonialController@edit')->name('backend.testimonial.edit');
    Route::put('testimonial/{id}/update', 'TestimonialController@update')->name('backend.testimonial.update');
    Route::delete('testimonial/{id}/delete', 'TestimonialController@destroy')->name('backend.testimonial.destroy');
    Route::get('testimonial/{id}/show', 'TestimonialController@show')->name('backend.testimonial.show');

    //Alumni Routes
    Route::get('alumni/create', 'AlumniController@create')->name('backend.alumni.create');
    Route::post('alumni/store', 'AlumniController@store')->name('backend.alumni.store');
    Route::get('alumni', 'AlumniController@index')->name('backend.alumni.index');
    Route::get('alumni/{id}/edit', 'AlumniController@edit')->name('backend.alumni.edit');
    Route::put('alumni/{id}/update', 'AlumniController@update')->name('backend.alumni.update');
    Route::delete('alumni/{id}/delete', 'AlumniController@destroy')->name('backend.alumni.destroy');
    Route::get('alumni/{id}/show', 'AlumniController@show')->name('backend.alumni.show');

    //Life At Routes
    Route::get('canvas-life/create', 'CanvasLifeController@create')->name('backend.canvasLife.create');
    Route::post('canvas-life/store', 'CanvasLifeController@store')->name('backend.canvasLife.store');
    Route::get('canvas-life', 'CanvasLifeController@index')->name('backend.canvasLife.index');
    Route::get('canvas-life/{id}/edit', 'CanvasLifeController@edit')->name('backend.canvasLife.edit');
    Route::put('canvas-life/{id}/update', 'CanvasLifeController@update')->name('backend.canvasLife.update');
    Route::delete('canvas-life/{id}/delete', 'CanvasLifeController@destroy')->name('backend.canvasLife.destroy');
    Route::get('canvas-life/{id}/show', 'CanvasLifeController@show')->name('backend.canvasLife.show');

    //Notice And Announcement Routes
    Route::get('notice/create', 'NoticeController@create')->name('backend.notice.create');
    Route::post('notice/store', 'NoticeController@store')->name('backend.notice.store');
    Route::get('notice', 'NoticeController@index')->name('backend.notice.index');
    Route::get('notice/{id}/edit', 'NoticeController@edit')->name('backend.notice.edit');
    Route::put('notice/{id}/update', 'NoticeController@update')->name('backend.notice.update');
    Route::delete('notice/{id}/delete', 'NoticeController@destroy')->name('backend.notice.destroy');
    Route::get('notice/{id}/show', 'NoticeController@show')->name('backend.notice.show');

    //Event  Routes
    Route::get('event/create', 'EventController@create')->name('backend.event.create');
    Route::post('event/store', 'EventController@store')->name('backend.event.store');
    Route::get('event', 'EventController@index')->name('backend.event.index');
    Route::get('event/{id}/edit', 'EventController@edit')->name('backend.event.edit');
    Route::put('event/{id}/update', 'EventController@update')->name('backend.event.update');
    Route::delete('event/{id}/delete', 'EventController@destroy')->name('backend.event.destroy');
    Route::get('event/{id}/show', 'EventController@show')->name('backend.event.show');

    Route::post('ajax/deleteEventImageByID', 'EventController@deleteEventImageByID')->name('backend.event.image.delete');

    //Gallery Route
    Route::get('gallery/create', 'GalleryController@create')->name('backend.gallery.create');
    Route::post('gallery/store', 'GalleryController@store')->name('backend.gallery.store');
    Route::get('gallery', 'GalleryController@index')->name('backend.gallery.index');
    Route::get('gallery/{id}/edit', 'GalleryController@edit')->name('backend.gallery.edit');
    Route::put('gallery/{id}/update', 'GalleryController@update')->name('backend.gallery.update');
    Route::delete('gallery/{id}/delete', 'GalleryController@destroy')->name('backend.gallery.destroy');
    Route::get('gallery/{id}/show', 'GalleryController@show')->name('backend.gallery.show');

    //Scholarship Scheme
    Route::get('scholarship/create', 'ScholarshipController@create')->name('backend.scholarship.create');
    Route::post('scholarship/store', 'ScholarshipController@store')->name('backend.scholarship.store');
    Route::get('scholarship', 'ScholarshipController@index')->name('backend.scholarship.index');
    Route::get('scholarship/{id}/edit', 'ScholarshipController@edit')->name('backend.scholarship.edit');
    Route::put('scholarship/{id}/update', 'ScholarshipController@update')->name('backend.scholarship.update');
    Route::delete('scholarship/{id}/delete', 'ScholarshipController@destroy')->name('backend.scholarship.destroy');
    Route::get('scholarship/{id}/show', 'ScholarshipController@show')->name('backend.scholarship.show');

    //Syllabus Routes
    Route::get('syllabus/create', 'SyllabusController@create')->name('backend.syllabus.create');
    Route::post('syllabus/store', 'SyllabusController@store')->name('backend.syllabus.store');
    Route::get('syllabus', 'SyllabusController@index')->name('backend.syllabus.index');
    Route::get('syllabus/{id}/edit', 'SyllabusController@edit')->name('backend.syllabus.edit');
    Route::put('syllabus/{id}/update', 'SyllabusController@update')->name('backend.syllabus.update');
    Route::delete('syllabus/{id}/delete', 'SyllabusController@destroy')->name('backend.syllabus.destroy');
    Route::get('syllabus/{id}/show', 'SyllabusController@show')->name('backend.syllabus.show');

    //College Hour Routes
    Route::get('hour/create', 'HourController@create')->name('backend.hour.create');
    Route::post('hour/store', 'HourController@store')->name('backend.hour.store');
    Route::get('hour', 'HourController@index')->name('backend.hour.index');
    Route::get('hour/{id}/edit', 'HourController@edit')->name('backend.hour.edit');
    Route::put('hour/{id}/update', 'HourController@update')->name('backend.hour.update');
    Route::delete('hour/{id}/delete', 'HourController@destroy')->name('backend.hour.destroy');
    Route::get('hour/{id}/show', 'HourController@show')->name('backend.hour.show');

    //Counter Routes
    Route::get('counter/create', 'CounterController@create')->name('backend.counter.create');
    Route::post('counter/store', 'CounterController@store')->name('backend.counter.store');
    Route::get('counter', 'CounterController@index')->name('backend.counter.index');
    Route::get('counter/{id}/edit', 'CounterController@edit')->name('backend.counter.edit');
    Route::put('counter/{id}/update', 'CounterController@update')->name('backend.counter.update');
    Route::delete('counter/{id}/delete', 'CounterController@destroy')->name('backend.counter.destroy');
    Route::get('counter/{id}/show', 'CounterController@show')->name('backend.counter.show');

    //User Routes
    Route::get('user/create', 'UserController@create')->name('backend.user.create');
    Route::post('user/store', 'UserController@store')->name('backend.user.store');
    Route::get('user', 'UserController@index')->name('backend.user.index');
    Route::get('user/{id}/edit', 'UserController@edit')->name('backend.user.edit');
    Route::put('user/{id}/update', 'UserController@update')->name('backend.user.update');
    Route::delete('user/{id}/delete', 'UserController@destroy')->name('backend.user.destroy');
    Route::get('user/{id}/show', 'UserController@show')->name('backend.user.show');


    Route::get('user/password', 'UserController@passwordForm')->name('backend.user.passwordForm');
    Route::put('password/update', 'UserController@updatePassword')->name('backend.user.updatePassword');

    //Site Configuration
    Route::get('configuration/create', 'ConfigurationController@create')->name('backend.configuration.create');
    Route::get('configuration', 'ConfigurationController@index')->name('backend.configuration.index');
    Route::get('configuration/{id}/edit', 'ConfigurationController@edit')->name('backend.configuration.edit');
    Route::put('configuration/{id}/update', 'ConfigurationController@update')->name('backend.configuration.update');
    //Email
    Route::get('contact/list', 'ContactUsController@index')->name('backend.contact.index');
    Route::delete('contact/delete/{id}', 'ContactUsController@destroy')->name('backend.contact.destroy');
});
