0% found this document useful (0 votes)
9 views4 pages

Rotas Antigas Ead

The document outlines the web routes for a Laravel application, including routes for authentication, managing subjects, student and teacher profiles, and administrative functions. It includes middleware for authentication and organizes routes into groups for students, teachers, and administrators. Additionally, it incorporates chat functionalities for both students and teachers.

Uploaded by

Emanuel André
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Rotas Antigas Ead

The document outlines the web routes for a Laravel application, including routes for authentication, managing subjects, student and teacher profiles, and administrative functions. It includes middleware for authentication and organizes routes into groups for students, teachers, and administrators. Additionally, it incorporates chat functionalities for both students and teachers.

Uploaded by

Emanuel André
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

<?

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!
|
*/
use App\Http\Controllers\StudentSubjectController;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\SubjectController;
use App\Http\Controllers\TeacherController;
use App\Http\Controllers\StudentController;
use App\Http\Controllers\ContentController;
use App\Http\Controllers\WelcomeController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\TableStudentController;
use App\Http\Controllers\TableContentController;
use App\Http\Controllers\ChatController;
use App\Http\Controllers\ChatTeacherController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\MakeTestController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\StudentTestController;

/* ROTAS DE LOGIN E CRIAÇÃO DE CONTA(PARA OS ALUNOS) */


Route::get('/login', [AuthController::class, 'showLoginForm'])->name('login');
Route::post('/login', [AuthController::class, 'login']);
Route::get('/dashboard', [AuthController::class, 'dashboard'])->middleware('auth');

/* CRIAR DISCIPLINA */
Route::get('/admin/subject', [SubjectController::class, 'index']);
Route::get('/admin/subject/create', [SubjectController::class, 'create'])-
>middleware('auth');
Route::get('/admin/subject/{id}', [SubjectController::class, 'show']);
Route::post('/subject', [SubjectController::class, 'store']);
Route::delete('/admin/subject/{id}', [SubjectController::class, 'destroy'])-
>middleware('auth');
Route::get('/admin/editsubject/{id}', [SubjectController::class, 'edit'])-
>middleware('auth');
Route::put('/admin/subject/update/{id}', [SubjectController::class, 'update'])-
>middleware('auth');

/* EDITAR O PERFIL DO ADMINISTRADOR LOGADO */


Route::middleware(['auth'])->group(function() {
Route::get('/admin/profile', [ProfileController::class, 'edit'])-
>name('profile.edit');
Route::post('/admin/profile', [ProfileController::class, 'update'])-
>name('profile.update');
});

/*EDITAR ALUNO E PROF */


Route::middleware(['auth'])->group(function () {
Route::get('/professor/profile', [ProfileController::class, 'edit'])-
>name('professor.profile.edit');
Route::post('/professor/profile', [ProfileController::class, 'update'])-
>name('professor.profile.update');

Route::get('/aluno/profile', [ProfileController::class, 'edit'])-


>name('aluno.profile.edit');
Route::post('/aluno/profile', [ProfileController::class, 'update'])-
>name('aluno.profile.update');
});

/* CRIAR, EDITAR, VISUALIZAR E DELETAR USUÁRIOS(ALUNO E PROFESSOR) */


Route::group([
'prefix' => 'admin',
'middleware' => 'auth'
], function(){

/* students */
Route::group([
'prefix' => 'alunos',
'middleware' => 'auth'
], function(){
Route::get('/', ['as' => 'admin.alunos', 'uses' => 'Admin\
MainController@list_students']);
Route::get('cadastrar', ['as' => 'admin.aluno.create', 'uses' => 'Admin\
Aluno\MainController@show_view_create_aluno']);
Route::post('store', ['as' => 'admin.aluno.store', 'uses' => 'Admin\Aluno\
MainController@store']);
Route::get('remove/{id}', ['as' => 'admin.aluno.remove', 'uses' => 'Admin\
Aluno\MainController@remove']);
Route::get('actualizar/{id}', ['as' => 'admin.aluno.actualizar', 'uses' =>
'Admin\Aluno\MainController@show_view_edit']);
Route::post('update/{id}', ['as' => 'admin.aluno.update', 'uses' => 'Admin\
Aluno\MainController@update']);
});

/* teachers */
Route::group([
'prefix' => 'professores',
'middleware' => 'auth'
], function(){
Route::get('/', ['as' => 'admin.professores', 'uses' => 'Admin\
MainController@list_profs']);
Route::get('cadastrar', ['as' => 'admin.professor.create', 'uses' =>
'Admin\Professor\MainController@show_view_create_teacher']);
Route::post('store', ['as' => 'admin.professor.store', 'uses' => 'Admin\
Professor\MainController@store']);
Route::get('remove/{id}', ['as' => 'admin.professor.remove', 'uses' =>
'Admin\Professor\MainController@remove']);
Route::get('actualizar/{id}', ['as' => 'admin.professor.actualizar', 'uses'
=> 'Admin\Professor\MainController@show_view_edit']);
Route::post('update/{id}', ['as' => 'admin.professor.update', 'uses' =>
'Admin\Professor\MainController@update']);
});

});
//ROTAS DO ADMIN

Route::get('/admin/dashboard', [DashboardController::class, 'index'])-


>name('dashboard');

Route::get('/admin/profile', function () {
return view('admin.profile');
});

Route::delete('/administradores/{id}', [DashboardController::class,
'eliminarAdministrador'])->name('administradores.eliminar');

//ROTAS DO PROFESSOR
Route::middleware(['auth'])->group(function () {
Route::get('/prof/sendContent/{id?}', [ContentController::class, 'create'])-
>name('content.create');
Route::post('/prof/sendContent', [ContentController::class, 'store'])-
>name('content.store');
});
Route::get('/prof/editContent/{id}', [ContentController::class, 'edit'])-
>name('content.edit');
Route::post('/prof/updateContent/{id}', [ContentController::class, 'update'])-
>name('content.update');
Route::delete('/prof/contents/{id}', [TableContentController::class, 'destroy'])-
>name('content.destroy');

Route::get('/prof/createModule', [App\Http\Controllers\ModuleController::class,
'create'])->name('modules.create');
Route::post('/prof/createModule', [App\Http\Controllers\ModuleController::class,
'store'])->name('modules.store');
Route::get('/prof/createModule/{id}', [App\Http\Controllers\
ModuleController::class, 'show']);
Route::get('/prof/dashboard', [TeacherController::class, 'index']);
Route::get('/prof/dashboard/search', [TeacherController::class, 'search'])-
>name('prof.dashboard.search');

Route::get('/prof/students', [TableStudentController::class, 'index'])-


>name('prof.students.search');
Route::get('/prof/student-list', [TableStudentController::class, 'index'])-
>name('students.index');

Route::get('/prof/contents', [TableContentController::class, 'index'])-


>name('prof.contents');
Route::get('/prof/contents/search', [TableContentController::class, 'search'])-
>name('prof.contents.search');

Route::delete('/professor/students/{studentId}/subject/{subjectId}',
[TableStudentController::class, 'removeStudentFromSubject'])-
>name('prof.remove_student');

Route::get('/prof/profile', function () {
return view('prof.profile');

});

Route::middleware(['auth'])->group(function () {
Route::get('/prof/test/{id?}', [TestController::class, 'create'])-
>name('test.create');
Route::post('/prof/test', [TestController::class, 'store'])-
>name('test.store');
});
Route::get('/prof/tests', [TestController::class, 'index'])-
>name('prof.tests.index');
Route::delete('/prof/tests/{id}', [TestController::class, 'destroy'])-
>name('prof.tests.destroy');

//ROTAS DO ALUNO
Route::get('/aluno/dashboard', [StudentController::class, 'index']);
Route::get('/aluno/content/{id}', [ContentController::class, 'show'])-
>name('content.show');

// Exibir o teste
Route::get('/aluno/test/{id}', [MakeTestController::class, 'show'])-
>name('aluno.test.show');

// Submeter o teste
Route::post('/aluno/test/{id}/submit', [MakeTestController::class, 'submitTest'])-
>name('aluno.test.submit');

Route::middleware(['auth'])->group(function () {
Route::get('/aluno/tests-list', [StudentTestController::class, 'index'])-
>name('aluno.tests.list');
Route::get('/aluno/tests/{test}/answers', [StudentTestController::class,
'showAnswers'])->name('aluno.tests.answers');
});

Route::get('/aluno/profile', function () {
return view('aluno.profile');
});

// Rota para associar o aluno à disciplina


Route::post('/aluno/enroll/{id}', [StudentController::class, 'enroll'])-
>name('aluno.enroll');

// ROTAS DE CHAT DO ALUNO


Route::get('chats/chat/{id}', [ChatController::class, 'chat'])->name('chats.chat');
Route::post('chats/chat/{chatId}/send', [ChatController::class, 'sendMessage'])-
>name('chats.send');
Route::get('/chats/chat/{chatId}/fetch-messages', [ChatController::class,
'fetchMessages'])->name('chats.fetchMessages');

// ROTAS DE CHAT DO PROFESSOR


Route::get('prof/chat/{id}', [ChatTeacherController::class, 'chat'])-
>name('prof.chat');
Route::post('prof/chat/{chatId}/send', [ChatTeacherController::class,
'sendMessage'])->name('prof.send');
Route::get('/prof/chat/{chatId}/fetch-messages', [ChatController::class,
'fetchMessages'])->name('prof.fetchMessages');

/*ROTAS EXTRAS*/
Auth::routes();

Route::get('/', [WelcomeController::class, 'index']);

You might also like