1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 19:04:31 +00:00
Files
education-project/routes/api.php
nikden13 e19ab81ddd get user
2020-12-16 15:25:42 +07:00

49 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'auth'], function () {
Route::post('register', 'Auth\RegisterController');
Route::post('login', 'Auth\LoginController');
Route::post('logout', 'Auth\LogoutController')->middleware('auth:api');
});
Route::get('users', 'Users\UserController@getUser')->middleware('auth:api');
Route::apiResource('chat/links', 'ChatLinkController')->except(['show'])->middleware('auth:api'); // ссылки чата
Route::apiResource('headteachers', 'Users\HeadTeacherController');
Route::apiResource('teachers', 'Users\TeacherController');//->middleware(['auth:api','role:headteacher|teacher']);
Route::get('teacher/{teacher}/classes', 'Users\TeacherController@getClasses'); //получить классы у которых ведет учитель
Route::apiResource('students', 'Users\StudentController');
Route::apiResource('parents', 'Users\ParenttController');
Route::apiResource('subjects', 'SubjectController');
Route::apiResource('classes', 'SchoolClassController');
Route::post('classes/{class}/teacher', 'SchoolClassController@addTeacher');
Route::get('classes/{class}/students', 'SchoolClassController@getStudents'); //все ученики класса
Route::get('classes/{class}/subjects', 'SchoolClassController@getSubjects'); //все предметы класса
Route::apiResource('themes', 'ThemeController');
Route::apiResource('timetables', 'TimetableController');
Route::get('banktasks', 'BankTaskController@index'); //получение списка всех заданий
Route::group(['prefix' => 'banktask'], function () {
Route::post('', 'BankTaskController@store'); //создание задания
Route::get('{banktask}', 'BankTaskController@show'); //получение задания
Route::put('{banktask}', 'BankTaskController@update'); //обновление задания
Route::delete('{banktask}', 'BankTaskController@delete'); //удаление задания
Route::post('{banktask}/addfile', 'BankTaskFileController@store');
Route::get('{banktask}/files', 'BankTaskFileController@showFiles');
});
Route::get('/file/{file}/download', 'BankTaskFileController@download');
Route::delete('/file/{file}/delete', 'BankTaskFileController@delete');
Route::put('/file/{file}/update', 'BankTaskFileController@update');