From 244c56df398699b2afb6b35c2bc6edc8f4270c2c Mon Sep 17 00:00:00 2001 From: mirivlad Date: Wed, 25 Mar 2026 17:30:37 +0800 Subject: [PATCH] =?UTF-8?q?LMS=20=D0=AD=D1=82=D0=B0=D0=BF=201=20MVP=20-=20?= =?UTF-8?q?Laravel=2013?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Базовая функциональность: - Аутентификация (вход/выход/регистрация) - Роли и разрешения (Administrator, Manager, Curator, Student) - Панель управления (dashboard) для разных ролей ✅ База данных (23 миграции): - users, organizations, groups, user_groups - course_categories, courses, course_modules - tests, questions, answers, question_matching_pairs - test_attempts, test_responses - course_requests, course_request_items, course_assignments - scorm_data, user_course_progress, logs - permission tables ✅ Модели (15 моделей с отношениями): - User, Organization, Group - CourseCategory, Course, CourseModule - Test, Question, Answer, QuestionMatchingPair - TestAttempt, TestResponse - CourseRequest, CourseRequestItem, CourseAssignment - ScormData, UserCourseProgress, Log ✅ Seeders: - RoleSeeder (роли и разрешения) - UserSeeder (тестовые пользователи) ✅ Контроллеры: - LoginController, RegisterController, DashboardController ✅ Blade-шаблоны: - layouts/app.blade.php - auth/login.blade.php, auth/register.blade.php - dashboard/admin.blade.php, dashboard/curator.blade.php, dashboard/student.blade.php 📦 Пакеты: - Laravel 13 (dev-master) - spatie/laravel-permission - laravel/sanctum 🔧 Инфраструктура: - Nginx конфигурация - PHP 8.4-FPM - MariaDB Co-authored-by: Qwen-Coder --- .editorconfig | 18 + .env.example | 59 + .gitattributes | 11 + .gitignore | 19 + README.md | 66 + TZ.md | 212 + app/Console/Kernel.php | 27 + app/Exceptions/Handler.php | 30 + app/Http/Controllers/Auth/LoginController.php | 50 + .../Controllers/Auth/RegisterController.php | 40 + app/Http/Controllers/Controller.php | 12 + app/Http/Controllers/DashboardController.php | 84 + app/Http/Kernel.php | 68 + app/Http/Middleware/Authenticate.php | 17 + app/Http/Middleware/EncryptCookies.php | 17 + .../PreventRequestsDuringMaintenance.php | 17 + .../Middleware/RedirectIfAuthenticated.php | 30 + app/Http/Middleware/TrimStrings.php | 19 + app/Http/Middleware/TrustHosts.php | 20 + app/Http/Middleware/TrustProxies.php | 28 + app/Http/Middleware/ValidateSignature.php | 22 + app/Http/Middleware/VerifyCsrfToken.php | 17 + app/Models/Answer.php | 33 + app/Models/Course.php | 77 + app/Models/CourseAssignment.php | 56 + app/Models/CourseCategory.php | 41 + app/Models/CourseModule.php | 55 + app/Models/CourseRequest.php | 46 + app/Models/CourseRequestItem.php | 33 + app/Models/Group.php | 40 + app/Models/Log.php | 40 + app/Models/Organization.php | 53 + app/Models/Question.php | 47 + app/Models/QuestionMatchingPair.php | 25 + app/Models/ScormData.php | 36 + app/Models/Test.php | 53 + app/Models/TestAttempt.php | 46 + app/Models/TestResponse.php | 42 + app/Models/User.php | 109 + app/Models/UserCourseProgress.php | 42 + app/Providers/AppServiceProvider.php | 24 + app/Providers/AuthServiceProvider.php | 26 + app/Providers/BroadcastServiceProvider.php | 19 + app/Providers/EventServiceProvider.php | 38 + app/Providers/RouteServiceProvider.php | 40 + artisan | 53 + bootstrap/app.php | 55 + bootstrap/cache/.gitignore | 2 + composer.json | 71 + composer.lock | 7474 +++++++++++++++++ config/app.php | 188 + config/auth.php | 115 + config/broadcasting.php | 71 + config/cache.php | 111 + config/cors.php | 34 + config/database.php | 151 + config/filesystems.php | 76 + config/hashing.php | 54 + config/logging.php | 131 + config/mail.php | 134 + config/permission.php | 111 + config/queue.php | 109 + config/sanctum.php | 83 + config/services.php | 34 + config/session.php | 214 + config/view.php | 36 + database/.gitignore | 1 + database/factories/UserFactory.php | 44 + .../2014_10_12_000000_create_users_table.php | 40 + ...000_create_password_reset_tokens_table.php | 28 + ..._08_19_000000_create_failed_jobs_table.php | 32 + ...01_create_personal_access_tokens_table.php | 33 + ...1_01_000001_create_organizations_table.php | 32 + .../2024_01_01_000002_create_groups_table.php | 28 + ..._01_01_000003_create_user_groups_table.php | 26 + ..._000001_create_course_categories_table.php | 31 + ...2024_01_02_000002_create_courses_table.php | 42 + ..._02_000003_create_course_modules_table.php | 35 + .../2024_01_03_000001_create_tests_table.php | 36 + ...24_01_03_000002_create_questions_table.php | 31 + ...2024_01_03_000003_create_answers_table.php | 27 + ...4_create_question_matching_pairs_table.php | 28 + ...1_03_000005_create_test_attempts_table.php | 35 + ..._03_000006_create_test_responses_table.php | 31 + ...04_000001_create_course_requests_table.php | 31 + ...0002_create_course_request_items_table.php | 28 + ...000003_create_course_assignments_table.php | 39 + ...4_01_05_000001_create_scorm_data_table.php | 32 + ...0002_create_user_course_progress_table.php | 33 + .../2024_01_05_000003_create_logs_table.php | 35 + ...000001_add_foreign_keys_to_users_table.php | 22 + ..._02_01_000001_create_permission_tables.php | 81 + database/seeders/DatabaseSeeder.php | 16 + database/seeders/RoleSeeder.php | 92 + database/seeders/UserSeeder.php | 75 + laravel.zip | Bin 0 -> 57200 bytes package.json | 13 + phpunit.xml | 32 + public/.htaccess | 21 + public/favicon.ico | 0 public/index.php | 55 + public/robots.txt | 2 + resources/css/app.css | 0 resources/js/app.js | 1 + resources/js/bootstrap.js | 32 + resources/views/auth/login.blade.php | 63 + resources/views/auth/register.blade.php | 82 + resources/views/dashboard.blade.php | 92 + resources/views/dashboard/admin.blade.php | 121 + resources/views/dashboard/curator.blade.php | 85 + resources/views/dashboard/student.blade.php | 82 + resources/views/layouts/app.blade.php | 113 + resources/views/welcome.blade.php | 140 + routes/api.php | 19 + routes/channels.php | 18 + routes/console.php | 19 + routes/web.php | 32 + storage/app/.gitignore | 3 + storage/app/public/.gitignore | 2 + storage/framework/.gitignore | 9 + storage/framework/cache/.gitignore | 3 + storage/framework/cache/data/.gitignore | 2 + storage/framework/sessions/.gitignore | 2 + storage/framework/testing/.gitignore | 2 + storage/framework/views/.gitignore | 2 + storage/logs/.gitignore | 2 + tests/CreatesApplication.php | 21 + tests/Feature/ExampleTest.php | 19 + tests/TestCase.php | 10 + tests/Unit/ExampleTest.php | 16 + vite.config.js | 11 + 131 files changed, 13381 insertions(+) create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.md create mode 100644 TZ.md create mode 100644 app/Console/Kernel.php create mode 100644 app/Exceptions/Handler.php create mode 100644 app/Http/Controllers/Auth/LoginController.php create mode 100644 app/Http/Controllers/Auth/RegisterController.php create mode 100644 app/Http/Controllers/Controller.php create mode 100644 app/Http/Controllers/DashboardController.php create mode 100644 app/Http/Kernel.php create mode 100644 app/Http/Middleware/Authenticate.php create mode 100644 app/Http/Middleware/EncryptCookies.php create mode 100644 app/Http/Middleware/PreventRequestsDuringMaintenance.php create mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php create mode 100644 app/Http/Middleware/TrimStrings.php create mode 100644 app/Http/Middleware/TrustHosts.php create mode 100644 app/Http/Middleware/TrustProxies.php create mode 100644 app/Http/Middleware/ValidateSignature.php create mode 100644 app/Http/Middleware/VerifyCsrfToken.php create mode 100644 app/Models/Answer.php create mode 100644 app/Models/Course.php create mode 100644 app/Models/CourseAssignment.php create mode 100644 app/Models/CourseCategory.php create mode 100644 app/Models/CourseModule.php create mode 100644 app/Models/CourseRequest.php create mode 100644 app/Models/CourseRequestItem.php create mode 100644 app/Models/Group.php create mode 100644 app/Models/Log.php create mode 100644 app/Models/Organization.php create mode 100644 app/Models/Question.php create mode 100644 app/Models/QuestionMatchingPair.php create mode 100644 app/Models/ScormData.php create mode 100644 app/Models/Test.php create mode 100644 app/Models/TestAttempt.php create mode 100644 app/Models/TestResponse.php create mode 100644 app/Models/User.php create mode 100644 app/Models/UserCourseProgress.php create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/Providers/AuthServiceProvider.php create mode 100644 app/Providers/BroadcastServiceProvider.php create mode 100644 app/Providers/EventServiceProvider.php create mode 100644 app/Providers/RouteServiceProvider.php create mode 100755 artisan create mode 100644 bootstrap/app.php create mode 100755 bootstrap/cache/.gitignore create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config/app.php create mode 100644 config/auth.php create mode 100644 config/broadcasting.php create mode 100644 config/cache.php create mode 100644 config/cors.php create mode 100644 config/database.php create mode 100644 config/filesystems.php create mode 100644 config/hashing.php create mode 100644 config/logging.php create mode 100644 config/mail.php create mode 100644 config/permission.php create mode 100644 config/queue.php create mode 100644 config/sanctum.php create mode 100644 config/services.php create mode 100644 config/session.php create mode 100644 config/view.php create mode 100644 database/.gitignore create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/2014_10_12_000000_create_users_table.php create mode 100644 database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php create mode 100644 database/migrations/2019_08_19_000000_create_failed_jobs_table.php create mode 100644 database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php create mode 100644 database/migrations/2024_01_01_000001_create_organizations_table.php create mode 100644 database/migrations/2024_01_01_000002_create_groups_table.php create mode 100644 database/migrations/2024_01_01_000003_create_user_groups_table.php create mode 100644 database/migrations/2024_01_02_000001_create_course_categories_table.php create mode 100644 database/migrations/2024_01_02_000002_create_courses_table.php create mode 100644 database/migrations/2024_01_02_000003_create_course_modules_table.php create mode 100644 database/migrations/2024_01_03_000001_create_tests_table.php create mode 100644 database/migrations/2024_01_03_000002_create_questions_table.php create mode 100644 database/migrations/2024_01_03_000003_create_answers_table.php create mode 100644 database/migrations/2024_01_03_000004_create_question_matching_pairs_table.php create mode 100644 database/migrations/2024_01_03_000005_create_test_attempts_table.php create mode 100644 database/migrations/2024_01_03_000006_create_test_responses_table.php create mode 100644 database/migrations/2024_01_04_000001_create_course_requests_table.php create mode 100644 database/migrations/2024_01_04_000002_create_course_request_items_table.php create mode 100644 database/migrations/2024_01_04_000003_create_course_assignments_table.php create mode 100644 database/migrations/2024_01_05_000001_create_scorm_data_table.php create mode 100644 database/migrations/2024_01_05_000002_create_user_course_progress_table.php create mode 100644 database/migrations/2024_01_05_000003_create_logs_table.php create mode 100644 database/migrations/2024_01_06_000001_add_foreign_keys_to_users_table.php create mode 100644 database/migrations/2024_02_01_000001_create_permission_tables.php create mode 100644 database/seeders/DatabaseSeeder.php create mode 100644 database/seeders/RoleSeeder.php create mode 100644 database/seeders/UserSeeder.php create mode 100644 laravel.zip create mode 100644 package.json create mode 100644 phpunit.xml create mode 100644 public/.htaccess create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/robots.txt create mode 100644 resources/css/app.css create mode 100644 resources/js/app.js create mode 100644 resources/js/bootstrap.js create mode 100644 resources/views/auth/login.blade.php create mode 100644 resources/views/auth/register.blade.php create mode 100644 resources/views/dashboard.blade.php create mode 100644 resources/views/dashboard/admin.blade.php create mode 100644 resources/views/dashboard/curator.blade.php create mode 100644 resources/views/dashboard/student.blade.php create mode 100644 resources/views/layouts/app.blade.php create mode 100644 resources/views/welcome.blade.php create mode 100644 routes/api.php create mode 100644 routes/channels.php create mode 100644 routes/console.php create mode 100644 routes/web.php create mode 100755 storage/app/.gitignore create mode 100755 storage/app/public/.gitignore create mode 100755 storage/framework/.gitignore create mode 100755 storage/framework/cache/.gitignore create mode 100755 storage/framework/cache/data/.gitignore create mode 100755 storage/framework/sessions/.gitignore create mode 100755 storage/framework/testing/.gitignore create mode 100755 storage/framework/views/.gitignore create mode 100755 storage/logs/.gitignore create mode 100644 tests/CreatesApplication.php create mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/ExampleTest.php create mode 100644 vite.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8f0de65 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[docker-compose.yml] +indent_size = 4 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ea0665b --- /dev/null +++ b/.env.example @@ -0,0 +1,59 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=laravel +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +FILESYSTEM_DISK=local +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MEMCACHED_HOST=127.0.0.1 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=mailpit +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_HOST= +PUSHER_PORT=443 +PUSHER_SCHEME=https +PUSHER_APP_CLUSTER=mt1 + +VITE_APP_NAME="${APP_NAME}" +VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_HOST="${PUSHER_HOST}" +VITE_PUSHER_PORT="${PUSHER_PORT}" +VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" +VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcb21d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7fe978f --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +/.phpunit.cache +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/vendor +.env +.env.backup +.env.production +.phpunit.result.cache +Homestead.json +Homestead.yaml +auth.json +npm-debug.log +yarn-error.log +/.fleet +/.idea +/.vscode diff --git a/README.md b/README.md new file mode 100644 index 0000000..1824fc1 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +

Laravel Logo

+ +

+Build Status +Total Downloads +Latest Stable Version +License +

+ +## About Laravel + +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: + +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). + +Laravel is accessible, powerful, and provides tools required for large, robust applications. + +## Learning Laravel + +Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. + +You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. + +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. + +## Laravel Sponsors + +We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). + +### Premium Partners + +- **[Vehikl](https://vehikl.com/)** +- **[Tighten Co.](https://tighten.co)** +- **[WebReinvent](https://webreinvent.com/)** +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** +- **[64 Robots](https://64robots.com)** +- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** +- **[Cyber-Duck](https://cyber-duck.co.uk)** +- **[DevSquad](https://devsquad.com/hire-laravel-developers)** +- **[Jump24](https://jump24.co.uk)** +- **[Redberry](https://redberry.international/laravel/)** +- **[Active Logic](https://activelogic.com)** +- **[byte5](https://byte5.de)** +- **[OP.GG](https://op.gg)** + +## Contributing + +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). + +## Code of Conduct + +In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. + +## License + +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/TZ.md b/TZ.md new file mode 100644 index 0000000..c967e56 --- /dev/null +++ b/TZ.md @@ -0,0 +1,212 @@ + +Полное техническое задание (ТЗ) на LMS +1. Цель системы + + Создание LMS для организаций и индивидуальных пользователей. + + Управление курсами, тестами, назначениями, прогрессом. + + Поддержка SCORM 1.2/2004 через pipwerks SCORM API Wrapper с серверной частью и H5P (через H5P Core или сторонний сервис). + + Масштабируемость и расширяемость (календари, уведомления, заявки, API). + + Работа через веб-интерфейс на Laravel 10+, PHP 8.2+, Bootstrap 5. + +2. Пользователи и роли +Роль Возможности +Администратор Полный доступ: CRUD всех сущностей, настройки системы, роли, интеграции, логирование, отчёты +Менеджер Почти как админ, кроме системных настроек +Ответственный (куратор) Управление организацией, пользователями, группами, курсами, тестами, назначениями; просмотр прогресса учеников; обработка заявок; откат результатов +Учащийся (организация) Прохождение курсов и тестов, просмотр результатов +Индивидуальный учащийся Регистрация через форму (или создание админом); прохождение курсов и тестов; просмотр результатов + + Все роли управляются через Spatie Laravel Permission или кастомную систему прав. + + API доступ контролируется через Policies/Abilities. + +3. Курсы + + Категории курсов (course_categories) с возможностью вложенности. + + Структура курса: модули/уроки (course_modules). + + SCORM/H5P: + + SCORM: pipwerks SCORM API Wrapper (клиент) + серверные эндпоинты /scorm/{package_id}/{sco_id} для обработки LMSSetValue, LMSCommit, LMSFinish. + + Таблица scorm_data: + + id (PK), user_id (FK), course_id (FK), package_id, sco_id, data (JSON), last_access, created_at, updated_at + + Контроллер для выдачи SCO с проверкой прав доступа. + + H5P: интеграция через H5P Core или сторонний сервис, хранение прогресса в JSON или отдельной таблице. + + Пройденный курс включает пробный и итоговый тесты. + + Возможность повторного открытия курса/теста. + + Поддержка пересекающихся периодов для разных пользователей/организаций. + +4. Тестирование + + Типы вопросов: + + Single choice (выбор одного), + + Multiple choice (множественный выбор), + + Input (ввод текста), + + Matching (соответствие). + + Для matching: таблица question_matching_pairs с полями question_id, left_text, right_text, match_score. + + Поддержка ограничений времени, истории попыток, отката. + + Таблицы: tests, questions, answers, test_attempts, test_responses. + +5. Workflow заявок организаций + + Таблицы: + + course_requests: id, organization_id, requested_by_user_id, status (pending, approved, rejected), approved_by, approved_at, created_at, updated_at. + + course_request_items: связывает заявки, курсы и пользователей. + + Состояния заявки: создана → на подтверждении → одобрена/отклонена → назначена. + + Автоматическое распределение после подтверждения → записи в course_assignments. + +6. Назначения курсов + + Таблица course_assignments: + + id, course_id, organization_id (nullable), group_id (nullable), user_id (nullable), type ('individual','group','organization'), start_date, end_date, note, created_by + + Логика: + + Назначение на организацию → все пользователи получают доступ; новые пользователи получают доступ автоматически. + + Пересекающиеся периоды → отображается ближайший или актуальный период. + +7. Откат результатов + + Возможность отката: тесты, прогресс SCORM/H5P, или все вместе. + + История откатов фиксируется в logs. + +8. Отчёты и аналитика + + Прогресс учеников: фильтры по организации, группе, курсу, пользователю. + + История изменений результатов и откатов. + + Экспорт: CSV/Excel (laravel-excel), PDF (dompdf/wkhtmltopdf). + + Учёт заявок организаций и распределение курсов по пользователям. + +9. Архитектура и расширяемость + + MVC, Eloquent ORM, REST API-готовность. + + Интерфейсы для типов курсов, тестов, интеграций. + + События и слушатели для логирования и уведомлений. + + Сервис-провайдеры для подключения новых модулей. + + API через Laravel Sanctum/Passport. + +10. Безопасность и производительность + + Middleware, Hash, CSRF, XSS, контроль доступа через Policies. + + SCORM/H5P: проверка MIME-типа, sandbox, валидация + @stack('scripts') + + diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php new file mode 100644 index 0000000..638ec96 --- /dev/null +++ b/resources/views/welcome.blade.php @@ -0,0 +1,140 @@ + + + + + + + Laravel + + + + + + + + + + + + diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..889937e --- /dev/null +++ b/routes/api.php @@ -0,0 +1,19 @@ +get('/user', function (Request $request) { + return $request->user(); +}); diff --git a/routes/channels.php b/routes/channels.php new file mode 100644 index 0000000..5d451e1 --- /dev/null +++ b/routes/channels.php @@ -0,0 +1,18 @@ +id === (int) $id; +}); diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 0000000..e05f4c9 --- /dev/null +++ b/routes/console.php @@ -0,0 +1,19 @@ +comment(Inspiring::quote()); +})->purpose('Display an inspiring quote'); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..7ae5bcf --- /dev/null +++ b/routes/web.php @@ -0,0 +1,32 @@ +name('home'); + +// Маршруты аутентификации +Route::middleware('guest')->group(function () { + Route::get('login', [LoginController::class, 'showLoginForm'])->name('login'); + Route::post('login', [LoginController::class, 'login']); + Route::get('register', [RegisterController::class, 'showRegistrationForm'])->name('register'); + Route::post('register', [RegisterController::class, 'register']); +}); + +// Маршруты для авторизованных пользователей +Route::middleware('auth')->group(function () { + Route::post('logout', [LoginController::class, 'logout'])->name('logout'); + + Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard'); +}); diff --git a/storage/app/.gitignore b/storage/app/.gitignore new file mode 100755 index 0000000..8f4803c --- /dev/null +++ b/storage/app/.gitignore @@ -0,0 +1,3 @@ +* +!public/ +!.gitignore diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore new file mode 100755 index 0000000..05c4471 --- /dev/null +++ b/storage/framework/.gitignore @@ -0,0 +1,9 @@ +compiled.php +config.php +down +events.scanned.php +maintenance.php +routes.php +routes.scanned.php +schedule-* +services.json diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100755 index 0000000..01e4a6c --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/cache/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/testing/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php new file mode 100644 index 0000000..cc68301 --- /dev/null +++ b/tests/CreatesApplication.php @@ -0,0 +1,21 @@ +make(Kernel::class)->bootstrap(); + + return $app; + } +} diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php new file mode 100644 index 0000000..8364a84 --- /dev/null +++ b/tests/Feature/ExampleTest.php @@ -0,0 +1,19 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..2932d4a --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ +assertTrue(true); + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..421b569 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; + +export default defineConfig({ + plugins: [ + laravel({ + input: ['resources/css/app.css', 'resources/js/app.js'], + refresh: true, + }), + ], +});