<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| 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('/', function () {
//     return view('welcome');
// });

Auth::routes();

Route::get('/index', 'HomeController@index')->name('home');

Route::get('/', 'HomeController@index')->name('home');

Route::get('course', function () {
    return view('course.index');
});

Route::get('course/restore', [ 'as' => 'course.restore', 'uses' => 'CourseController@restore']);

Route::get('course/validateData',[ 'as' => 'course.validateData', 'uses' => 'CourseController@validateData'] );

Route::resources([
    'course' => 'CourseController',
]);

Route::get('api/courses', [ 'as' => 'course.list', 'uses' => 'CourseController@list']);

Route::get('batch', function () {

    return view('batch.index');
});

Route::get('batch/restore', [ 'as' => 'batch.restore', 'uses' => 'BatchController@restore']);

Route::get('batch/showbatches/{id}', [ 'as' => 'batch.showbatches', 'uses' => 'BatchController@showbatches']);

Route::resources([
    'batch' => 'BatchController',
]);

Route::get('api/allfacultybatches/{facultyid}', 'BatchController@allFacultyBatches');

Route::get('subject', function () {
    return view('subject.index');
});

Route::get('subject/restore', [ 'as' => 'subject.restore', 'uses' => 'SubjectController@restore']);

Route::get('subject/validateData',[ 'as' => 'subject.validateData', 'uses' => 'SubjectController@validateData'] );

Route::resources([
    'subject' => 'SubjectController',
]);

Route::get('api/subjects', [ 'as' => 'subject.list', 'uses' => 'SubjectController@list']);

Route::get('batchwisesubject', function () {
    return view('batchwisesubject.index');
});

Route::resources([
    'batchwisesubject' => 'BatchWiseSubjectController',
]);

Route::get('batchwisesubject/showsubjects/{batchid}/{semester}', [ 'as' => 'batchwisesubject.showsubjects', 'uses' => 'BatchWiseSubjectController@showsubjects']);

Route::get('faculty', function () {
    return view('faculty.index');
});

Route::get('faculty/restore', [ 'as' => 'faculty.restore', 'uses' => 'FacultyController@restore']);
Route::get('faculty/validateData',[ 'as' => 'faculty.validateData', 'uses' => 'FacultyController@validateData']);
Route::get('faculty/validateEmail',[ 'as' => 'faculty.validateEmail', 'uses' => 'FacultyController@validateEmail']);

Route::resources([
    'faculty' => 'FacultyController',
]);

Route::get('api/faculty', [ 'as' => 'faculty.list', 'uses' => 'FacultyController@list']);
Route::get('api/faculty/verifyLogin', 'FacultyController@verifyLogin');
Route::post('api/faculty/checkFacultyData', 'FacultyController@checkFacultyData');
Route::patch('api/faculty/updatepassword/{id}/{userid}', 'FacultyController@patchUpdatePassword');

Route::get('teachersubjectallocation', function () {
    return view('teachersubjectallocation.index');
});

Route::resources([
    'teachersubjectallocation' => 'TeacherSubjectAllocationController',
]);

Route::get('teachersubjectallocation/showallocation/{batchid}/{semester}', [ 'as' => 'teachersubjectallocation.showallocation', 'uses' => 'TeacherSubjectAllocationController@showallocation']);

Route::get('api/allfacultybatchwisesubjects/{facultyid}/{batchid}/{semester}', [ 'as' => 'teachersubjectallocation.allfacultybatchwisesubjects', 'uses' => 'TeacherSubjectAllocationController@allFacultyBatchwiseSubjects']);

// Route::get('student', function () {
//     return view('student.index');
// });

Route::get('student/restore', [ 'as' => 'student.restore', 'uses' => 'StudentController@restore']);

Route::get('student/{id}', [ 'as' => 'student.index', 'uses' => 'StudentController@index']);

Route::get('student/showstudents/{id}/{status}', [ 'as' => 'student.showstudents', 'uses' => 'StudentController@showstudents']);

Route::get('student/create/{id}', [ 'as' => 'student.create', 'uses' => 'StudentController@create']);

Route::resources([
    'student' => 'StudentController',
]);

Route::get('api/student', [ 'as' => 'student.list', 'uses' => 'StudentController@list']);

Route::post('api/student/checkStudentData', 'StudentController@checkStudentData');

Route::post('api/student/verifyLogin', 'StudentController@verifyLogin');

Route::get('api/subject/list', 'SubjectController@list');

Route::patch('api/student/updatepassword/{id}/{userid}', 'StudentController@patchUpdatePassword');

Route::get('tutorialType', function () {
    return view('tutorialType.index');
});

Route::get('tutorialType/restore', [ 'as' => 'tutorialType.restore', 'uses' => 'TutorialTypeController@restore']);

Route::resources([
    'tutorialType' => 'TutorialTypeController',
]);

Route::get('api/tutorialTypes', [ 'as' => 'tutorialType.list', 'uses' => 'TutorialTypeController@list']);

Route::get('tutorial/restore', [ 'as' => 'tutorial.restore', 'uses' => 'TutorialController@restore']);

Route::get('tutorial/{id}', [ 'as' => 'tutorial.index', 'uses' => 'TutorialController@index']);

Route::get('tutorial/showtutorials/{id}/{status}', [ 'as' => 'tutorial.showtutorials', 'uses' => 'TutorialController@showtutorials']);

Route::get('tutorial/create/{facultyid}', [ 'as' => 'tutorial.create', 'uses' => 'TutorialController@create']);

Route::get('tutorial/downloadFile/{id}', [ 'as' => 'tutorial.downloadFile', 'uses' => 'TutorialController@downloadFile']);

Route::resources([
    'tutorial' => 'TutorialController',
]);

Route::get('api/tutorial', [ 'as' => 'tutorial.list', 'uses' => 'TutorialController@list']);

Route::post('api/tutorial/tutorialstore', 'TutorialController@store');

Route::get('api/alltutorials/{batchid}', [ 'as' => 'tutorial.alltutorials', 'uses' => 'TutorialController@allTutorials']);

Route::get('api/allfacultytutorials/{facultyid}', [ 'as' => 'tutorial.allfacultytutorials', 'uses' => 'TutorialController@allFacultyTutorials']);

Route::get('api/totalcount/{batchid}', [ 'as' => 'tutorial.totalcount', 'uses' => 'TutorialController@totalCount']);

Route::get('api/tutorialdetails/{id}', [ 'as' => 'tutorial.tutorialdetails', 'uses' => 'TutorialController@tutorialDetails']);

// Route::get('{any}', 'UboldController@index');

Route::get('mybatches', [ 'as' => 'mybatches.index', 'uses' => 'TeacherSubjectAllocationController@indexMyBatches']);

Route::get('mybatches/showsubjects/{id}', [ 'as' => 'mybatches.showsubjects', 'uses' => 'TeacherSubjectAllocationController@showSubjectsMyBatches']);

Route::get('mybatches/showtutorials/{batchid}/{semester}/{facultyid}/{subjectid}', [ 'as' => 'teachersubjectallocation.showtutorials', 'uses' => 'TeacherSubjectAllocationController@showTutorialsMyBatches']);

Route::get('messageType', function () {
    return view('messageType.index');
});

Route::get('messageType/restore', [ 'as' => 'messageType.restore', 'uses' => 'MessageTypeController@restore']);

Route::resources([
    'messageType' => 'MessageTypeController',
]);

Route::get('api/messageTypes', [ 'as' => 'messageType.list', 'uses' => 'MessageTypeController@list']);

Route::get('message/restore', [ 'as' => 'message.restore', 'uses' => 'MessageController@restore']);

Route::get('message/{id}', [ 'as' => 'message.index', 'uses' => 'MessageController@index']);

Route::get('message/showmessages/{id}/{status}', [ 'as' => 'message.showmessages', 'uses' => 'MessageController@showmessages']);

Route::get('message/create/{facultyid}', [ 'as' => 'message.create', 'uses' => 'MessageController@create']);

Route::get('message/downloadFile/{id}', [ 'as' => 'message.downloadFile', 'uses' => 'MessageController@downloadFile']);


Route::resources([
    'message' => 'MessageController',
]);


Route::get('api/message', [ 'as' => 'message.list', 'uses' => 'MessageController@list']);

Route::post('api/message/messagestore', 'MessageController@store');

Route::get('api/allmessages/{batchid}', [ 'as' => 'message.allmessages', 'uses' => 'MessageController@allMessages']);

Route::get('api/allfacultymessages/{facultyid}', [ 'as' => 'message.allfacultymessages', 'uses' => 'MessageController@allFacultyMessages']);

Route::get('api/messagedetails/{id}', [ 'as' => 'message.messagedetails', 'uses' => 'MessageController@messageDetails']);


Route::get('mymessages', [ 'as' => 'mymessages.index', 'uses' => 'TeacherSubjectAllocationController@indexMyMessages']);

Route::get('mymessages/showsubjects/{id}', [ 'as' => 'mymessages.showsubjects', 'uses' => 'TeacherSubjectAllocationController@showSubjectsMyBatches']);

Route::get('mymessages/showmessages/{batchid}/{semester}/{facultyid}/{subjectid}', [ 'as' => 'teachersubjectallocation.showmessages', 'uses' => 'TeacherSubjectAllocationController@showMessagesMyBatches']);
