├── public ├── favicon.ico ├── robots.txt ├── .htaccess └── index.php ├── database ├── .gitignore ├── seeders │ ├── files │ │ ├── courses │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ └── 8.png │ │ ├── posts │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ └── 8.png │ │ └── learning-paths │ │ │ ├── 1.png │ │ │ └── 2.png │ ├── ReviewSeeder.php │ ├── CategorySeeder.php │ ├── CourseRequirementSeeder.php │ ├── CourseLearnGoalSeeder.php │ ├── LearningPathSeeder.php │ ├── DatabaseSeeder.php │ ├── UserSeeder.php │ ├── CourseSeeder.php │ └── LessonSeeder.php ├── migrations │ ├── 2022_11_09_141108_create_categories_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2022_11_09_150946_create_course_requirements_table.php │ ├── 2022_11_09_150953_create_course_learn_goals_table.php │ ├── 2022_11_19_095024_create_course_user_table.php │ ├── 2022_11_27_224248_create_learning_paths_table.php │ ├── 2022_12_17_172555_create_student_lessons_table.php │ ├── 2022_12_04_012805_create_reviews_table.php │ ├── 2022_12_02_174937_create_social_accounts_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2022_11_22_231218_create_lessons_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2022_11_09_141834_create_posts_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2022_11_09_141841_create_courses_table.php │ └── 2022_11_09_142327_create_media_table.php └── factories │ └── UserFactory.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore ├── debugbar │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── pint.json ├── resources ├── images │ └── logo.png ├── js │ ├── components │ │ ├── Header.vue │ │ ├── Toast.vue │ │ ├── InputError.vue │ │ ├── Layout.vue │ │ ├── ReviewList.vue │ │ ├── CourseItem.vue │ │ ├── PostList.vue │ │ ├── PostItem.vue │ │ ├── CourseList.vue │ │ ├── LearningLayout.vue │ │ ├── ReviewItem.vue │ │ ├── Sidebar.vue │ │ ├── SocialLoginList.vue │ │ ├── ReviewForm.vue │ │ └── Footer.vue │ ├── icons │ │ ├── FacebookIcon.vue │ │ ├── TwitterIcon.vue │ │ └── GithubIcon.vue │ ├── Pages │ │ ├── Home.vue │ │ ├── Courses │ │ │ └── Index.vue │ │ ├── LearningPaths │ │ │ ├── Index.vue │ │ │ └── Show.vue │ │ ├── Blog │ │ │ ├── Show.vue │ │ │ └── Index.vue │ │ ├── Profile.vue │ │ ├── Learning.vue │ │ └── Settings.vue │ ├── app.js │ └── helpers.js ├── sass │ └── app.scss └── views │ └── app.blade.php ├── postcss.config.js ├── lang ├── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── vi │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── en.json └── vi.json ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .gitattributes ├── bin └── deploy.sh ├── .editorconfig ├── app ├── Filament │ ├── Resources │ │ ├── PostResource │ │ │ └── Pages │ │ │ │ ├── CreatePost.php │ │ │ │ ├── EditPost.php │ │ │ │ └── ListPosts.php │ │ ├── UserResource │ │ │ └── Pages │ │ │ │ ├── CreateUser.php │ │ │ │ ├── EditUser.php │ │ │ │ └── ListUsers.php │ │ ├── CourseResource │ │ │ └── Pages │ │ │ │ ├── CreateCourse.php │ │ │ │ ├── EditCourse.php │ │ │ │ └── ListCourses.php │ │ ├── CategoryResource │ │ │ ├── Pages │ │ │ │ ├── CreateCategory.php │ │ │ │ ├── EditCategory.php │ │ │ │ └── ListCategories.php │ │ │ └── RelationManagers │ │ │ │ ├── CoursesRelationManager.php │ │ │ │ └── PostsRelationManager.php │ │ ├── UserResource.php │ │ └── CategoryResource.php │ └── Widgets │ │ ├── StatsOverview.php │ │ ├── CoursesMostStudent.php │ │ └── RecentlySubscribedStudents.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── TrustHosts.php │ │ ├── TrimStrings.php │ │ ├── Authenticate.php │ │ ├── ValidateSignature.php │ │ ├── TrustProxies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── HandleInertiaRequests.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── ProfileController.php │ │ ├── Auth │ │ │ ├── LogoutController.php │ │ │ ├── RegisterController.php │ │ │ ├── LoginController.php │ │ │ └── SocialiteController.php │ │ ├── LearningPathController.php │ │ ├── HomeController.php │ │ ├── SettingController.php │ │ ├── ReviewController.php │ │ ├── PostController.php │ │ ├── LearningController.php │ │ └── CourseController.php │ ├── Requests │ │ ├── StoreReviewRequest.php │ │ ├── LoginRequest.php │ │ ├── UpdateProfileRequest.php │ │ └── RegisterRequest.php │ └── Kernel.php ├── Models │ ├── CourseLearnGoal.php │ ├── CourseRequirement.php │ ├── SocialAccount.php │ ├── CourseUser.php │ ├── StudentLesson.php │ ├── Category.php │ ├── LearningPath.php │ ├── Review.php │ ├── Lesson.php │ ├── Post.php │ ├── Course.php │ └── User.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Enums │ └── InstructionalLevel.php ├── Console │ └── Kernel.php └── Exceptions │ └── Handler.php ├── .gitignore ├── tailwind.config.js ├── vite.config.js ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── package.json ├── config ├── cors.php ├── view.php ├── services.php ├── hashing.php ├── broadcasting.php ├── sanctum.php ├── filesystems.php ├── queue.php ├── cache.php ├── mail.php └── auth.php ├── README.md ├── phpunit.xml ├── .env.example ├── docker-compose.yml ├── artisan └── composer.json /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "laravel" 3 | } 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/resources/images/logo.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /database/seeders/files/courses/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/1.png -------------------------------------------------------------------------------- /database/seeders/files/courses/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/2.png -------------------------------------------------------------------------------- /database/seeders/files/courses/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/3.png -------------------------------------------------------------------------------- /database/seeders/files/courses/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/4.png -------------------------------------------------------------------------------- /database/seeders/files/courses/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/5.png -------------------------------------------------------------------------------- /database/seeders/files/courses/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/6.png -------------------------------------------------------------------------------- /database/seeders/files/courses/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/7.png -------------------------------------------------------------------------------- /database/seeders/files/courses/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/courses/8.png -------------------------------------------------------------------------------- /database/seeders/files/posts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/1.png -------------------------------------------------------------------------------- /database/seeders/files/posts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/2.png -------------------------------------------------------------------------------- /database/seeders/files/posts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/3.png -------------------------------------------------------------------------------- /database/seeders/files/posts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/4.png -------------------------------------------------------------------------------- /database/seeders/files/posts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/5.png -------------------------------------------------------------------------------- /database/seeders/files/posts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/6.png -------------------------------------------------------------------------------- /database/seeders/files/posts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/7.png -------------------------------------------------------------------------------- /database/seeders/files/posts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/posts/8.png -------------------------------------------------------------------------------- /database/seeders/files/learning-paths/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/learning-paths/1.png -------------------------------------------------------------------------------- /database/seeders/files/learning-paths/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datlechin/PolyCourse/HEAD/database/seeders/files/learning-paths/2.png -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | 'Next »', 7 | 'previous' => '« Previous', 8 | ]; 9 | -------------------------------------------------------------------------------- /lang/vi/pagination.php: -------------------------------------------------------------------------------- 1 | 'Trang trước »', 7 | 'previous' => '« Trang sau', 8 | ]; 9 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | import Navbar from './Navbar.vue' 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /bin/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git checkout main 4 | git pull 5 | git checkout production 6 | git merge main 7 | npm run build 8 | git add . 9 | git commit -m "chore: build assets" 10 | git push origin production 11 | git checkout main 12 | -------------------------------------------------------------------------------- /resources/js/components/Toast.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&display=swap'); 2 | 3 | @tailwind base; 4 | @tailwind components; 5 | @tailwind utilities; 6 | 7 | body { 8 | font-family: 'Montserrat', sans-serif; 9 | } 10 | -------------------------------------------------------------------------------- /lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 7 | 'password' => 'The password is incorrect.', 8 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 9 | ]; 10 | -------------------------------------------------------------------------------- /resources/js/components/InputError.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /lang/vi/auth.php: -------------------------------------------------------------------------------- 1 | 'Thông tin tài khoản không tìm thấy trong hệ thống.', 7 | 'password' => 'Mật khẩu không đúng.', 8 | 'throttle' => 'Vượt quá số lần đăng nhập cho phép. Vui lòng thử lại sau :seconds giây.', 9 | ]; 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /app/Filament/Resources/PostResource/Pages/CreatePost.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/Pages/CreateCategory.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 7 | 'sent' => 'We have emailed your password reset link!', 8 | 'throttled' => 'Please wait before retrying.', 9 | 'token' => 'This password reset token is invalid.', 10 | 'user' => 'We can\'t find a user with that email address.', 11 | ]; 12 | -------------------------------------------------------------------------------- /lang/vi/passwords.php: -------------------------------------------------------------------------------- 1 | 'Mật khẩu mới đã được cập nhật!', 7 | 'sent' => 'Hướng dẫn cấp lại mật khẩu đã được gửi!', 8 | 'throttled' => 'Vui lòng đợi trước khi thử lại.', 9 | 'token' => 'Mã khôi phục mật khẩu không hợp lệ.', 10 | 'user' => 'Không tìm thấy người dùng với địa chỉ email này.', 11 | ]; 12 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./resources/**/*.blade.php", 5 | "./resources/**/*.js", 6 | "./resources/**/*.vue", 7 | ], 8 | theme: { 9 | extend: {}, 10 | }, 11 | plugins: [ 12 | require('@tailwindcss/forms'), 13 | require('@tailwindcss/typography'), 14 | ], 15 | } 16 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /database/seeders/ReviewSeeder.php: -------------------------------------------------------------------------------- 1 | 2 | import Header from './Header.vue' 3 | import Footer from './Footer.vue' 4 | import Sidebar from './Sidebar.vue' 5 | 6 | 7 | 17 | -------------------------------------------------------------------------------- /resources/js/components/ReviewList.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | -------------------------------------------------------------------------------- /app/Models/CourseLearnGoal.php: -------------------------------------------------------------------------------- 1 | belongsTo(Course::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Models/CourseRequirement.php: -------------------------------------------------------------------------------- 1 | belongsTo(Course::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/js/icons/FacebookIcon.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Models/SocialAccount.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/js/Pages/Home.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | import vue from '@vitejs/plugin-vue'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | laravel({ 8 | input: ['resources/js/app.js'], 9 | refresh: true, 10 | valetTls: 'pro1014.test', 11 | }), 12 | vue() 13 | ], 14 | resolve: { 15 | alias: { 16 | '@': '/resources/js', 17 | }, 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreReviewRequest.php: -------------------------------------------------------------------------------- 1 | 'required|numeric|min:1|max:5', 16 | 'content' => 'required|string|max:500', 17 | ]; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | ['required', 'email'], 16 | 'password' => ['required', 'string'], 17 | 'remember' => ['boolean'], 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Filament/Resources/PostResource/Pages/ListPosts.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ config('app.name') }} 8 | 9 | 10 | 11 | 12 | @vite('resources/js/app.js') 13 | @inertiaHead 14 | @routes 15 | 16 | 17 | @inertia 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/Pages/ListCategories.php: -------------------------------------------------------------------------------- 1 | ['required', 'min:3', 'max:150'], 16 | 'phone' => ['required', 'digits:10'], 17 | 'bio' => ['required', 'string', 'max:300'], 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProfileController.php: -------------------------------------------------------------------------------- 1 | where('username', $username) 15 | ->with('courses') 16 | ->firstOrFail(); 17 | 18 | return Inertia::render('Profile', [ 19 | 'user' => $user, 20 | ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Models/CourseUser.php: -------------------------------------------------------------------------------- 1 | belongsTo(Course::class); 18 | } 19 | 20 | public function user(): BelongsTo 21 | { 22 | return $this->belongsTo(User::class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/js/icons/TwitterIcon.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LogoutController.php: -------------------------------------------------------------------------------- 1 | session()->regenerateToken(); 17 | 18 | $request->session()->regenerate(); 19 | 20 | return to_route('home'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Models/StudentLesson.php: -------------------------------------------------------------------------------- 1 | belongsTo(CourseUser::class, 'course_user_id'); 18 | } 19 | 20 | public function lesson(): BelongsTo 21 | { 22 | return $this->belongsTo(Lesson::class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Enums/InstructionalLevel.php: -------------------------------------------------------------------------------- 1 | 'Trình độ cơ bản', 19 | self::Intermediate => 'Trình độ trung bình', 20 | self::Expert => 'Trình độ nâng cao', 21 | self::All => 'Tất cả', 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /resources/js/Pages/Courses/Index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /app/Http/Requests/RegisterRequest.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'min:4', 'max:50', 'unique:users,username'], 16 | 'name' => ['required', 'string', 'min:3', 'max:100'], 17 | 'email' => ['required', 'email', 'unique:users,email'], 18 | 'password' => ['required', 'string', 'min:6', 'max:100', 'confirmed'], 19 | ]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | hasMany(Post::class); 23 | } 24 | 25 | public function courses(): HasMany 26 | { 27 | return $this->hasMany(Course::class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "@tailwindcss/forms": "^0.5.3", 9 | "@tailwindcss/typography": "^0.5.8", 10 | "@vitejs/plugin-vue": "^4.0.0", 11 | "autoprefixer": "^10.4.13", 12 | "laravel-vite-plugin": "^0.7.2", 13 | "postcss": "^8.4.20", 14 | "tailwindcss": "^3.2.4", 15 | "vite": "^4.0.1" 16 | }, 17 | "dependencies": { 18 | "@heroicons/vue": "^2.0.13", 19 | "@inertiajs/vue3": "^1.0.0-beta.2", 20 | "sass": "^1.56.2", 21 | "vue": "^3.2.45", 22 | "ziggy-js": "^1.5.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/LearningPath.php: -------------------------------------------------------------------------------- 1 | $this->getFirstMediaUrl('learning-paths')); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Models/Review.php: -------------------------------------------------------------------------------- 1 | 'integer', 21 | ]; 22 | 23 | public function reviewable(): MorphTo 24 | { 25 | return $this->morphTo(); 26 | } 27 | 28 | public function author(): BelongsTo 29 | { 30 | return $this->belongsTo(User::class, 'user_id'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | $this->asset("resources/images/{$asset}")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/LearningPathController.php: -------------------------------------------------------------------------------- 1 | with('media') 15 | ->get(); 16 | 17 | return Inertia::render('LearningPaths/Index', [ 18 | 'learningPaths' => $learningPaths, 19 | ]); 20 | } 21 | 22 | public function show(LearningPath $learningPath): Response 23 | { 24 | return Inertia::render('LearningPaths/Show', [ 25 | 'learningPath' => $learningPath, 26 | ]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | with('media') 16 | ->withCount('students') 17 | ->limit(8) 18 | ->get(); 19 | 20 | $posts = Post::query() 21 | ->popular() 22 | ->with(['author', 'media']) 23 | ->limit(8) 24 | ->get(); 25 | 26 | return Inertia::render('Home', [ 27 | 'courses' => $courses, 28 | 'posts' => $posts, 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/SettingController.php: -------------------------------------------------------------------------------- 1 | $user, 19 | ]); 20 | } 21 | 22 | public function update(UpdateProfileRequest $request): RedirectResponse 23 | { 24 | $request->user()->update($request->validated()); 25 | 26 | return back()->with('success', 'Cập nhật thông tin cá nhân thành công'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Filament/Widgets/StatsOverview.php: -------------------------------------------------------------------------------- 1 | reviews()->where('user_id', Auth::id())->exists()) { 15 | return back()->with('error', 'Bạn đã đánh giá khóa học này rồi'); 16 | } 17 | 18 | $course->reviews()->create([ 19 | ...$request->validated(), 20 | 'user_id' => Auth::id(), 21 | ]); 22 | 23 | return back()->with('success', __('Nhận xét của bạn đã được gửi đi')); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import { createApp, h } from 'vue' 2 | import { createInertiaApp, usePage } from '@inertiajs/vue3' 3 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers' 4 | 5 | import '../sass/app.scss' 6 | import Layout from '@/components/Layout.vue' 7 | 8 | createInertiaApp({ 9 | resolve: (name) => { 10 | const page = resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')) 11 | page.then((module) => { 12 | module.default.layout = module.default.layout || Layout 13 | }) 14 | return page 15 | }, 16 | title: title => `${title} - ${usePage().props.value.appName}`, 17 | setup({el, App, props, plugin}) { 18 | createApp({render: () => h(App, props)}) 19 | .use(plugin) 20 | .mount(el) 21 | }, 22 | }) 23 | -------------------------------------------------------------------------------- /database/seeders/CategorySeeder.php: -------------------------------------------------------------------------------- 1 | $category, 28 | 'slug' => Str::slug($category), 29 | 'description' => fake()->realText(), 30 | ]); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_141108_create_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('slug')->unique(); 18 | $table->string('description', 300)->nullable(); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('categories'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_150946_create_course_requirements_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignIdFor(Course::class)->constrained(); 18 | $table->string('text'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('course_requirements'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_150953_create_course_learn_goals_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignIdFor(Course::class)->constrained(); 18 | $table->string('text'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('course_learn_goals'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/PostController.php: -------------------------------------------------------------------------------- 1 | with(['author', 'media']) 15 | ->paginate(); 16 | 17 | return Inertia::render('Blog/Index', [ 18 | 'posts' => $posts, 19 | ]); 20 | } 21 | 22 | public function show(string $slug): Response 23 | { 24 | $post = Post::query() 25 | ->where('slug', $slug) 26 | ->with('author') 27 | ->firstOrFail(); 28 | 29 | $post->increment('views'); 30 | 31 | return Inertia::render('Blog/Show', [ 32 | 'post' => $post, 33 | ]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Models/Lesson.php: -------------------------------------------------------------------------------- 1 | belongsTo(Course::class); 29 | } 30 | 31 | protected function youtubeUrl(): Attribute 32 | { 33 | return Attribute::get(fn () => "https://www.youtube-nocookie.com/embed/$this->youtube_id"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2022_11_19_095024_create_course_user_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(User::class)->constrained(); 19 | $table->foreignIdFor(Course::class)->constrained(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('course_user'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /resources/js/components/CourseItem.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 25 | -------------------------------------------------------------------------------- /resources/js/icons/GithubIcon.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /database/migrations/2022_11_27_224248_create_learning_paths_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('slug')->unique(); 18 | $table->string('description', 300)->nullable(); 19 | $table->text('content'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('learning_paths'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_17_172555_create_student_lessons_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(CourseUser::class)->constrained(); 19 | $table->foreignIdFor(Lesson::class)->constrained(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('student_lessons'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_04_012805_create_reviews_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignIdFor(User::class)->constrained(); 18 | $table->morphs('reviewable'); 19 | $table->tinyInteger('rating'); 20 | $table->string('content', 500); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('reviews'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /app/Filament/Widgets/CoursesMostStudent.php: -------------------------------------------------------------------------------- 1 | withCount('students') 18 | ->orderByDesc('students_count'); 19 | } 20 | 21 | protected function getTableColumns(): array 22 | { 23 | return [ 24 | Tables\Columns\TextColumn::make('name') 25 | ->label('Khoá học'), 26 | 27 | Tables\Columns\TextColumn::make('students_count') 28 | ->label('Học viên') 29 | ->counts('students'), 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_02_174937_create_social_accounts_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignIdFor(User::class)->constrained(); 18 | $table->string('provider_name'); 19 | $table->string('provider_id'); 20 | $table->text('token')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('social_accounts'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | validated(), 25 | 'password' => Hash::make($request->input('password')), 26 | ]); 27 | 28 | Auth::login($user); 29 | 30 | return to_route('home')->with('success', 'Đăng ký tài khoản thành công'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | $request->input('email'), 23 | 'password' => $request->input('password'), 24 | ]; 25 | 26 | if (! Auth::attempt($credentials, $request->boolean('remember'))) { 27 | return back()->withErrors(['email' => __('auth.failed')]); 28 | } 29 | 30 | return to_route('home')->with('success', 'Đăng nhập thành công'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PolyCourse 2 | 3 | ![](https://user-images.githubusercontent.com/56961917/205668331-1bbf26f1-b5b6-4b1a-bbb8-903b1783d054.png) 4 | 5 | ### Live demo: **[fpoly.site](https://fpoly.site)** 6 | 7 | ## Hướng dẫn setup 8 | 9 | ### Yêu cầu: 10 | 11 | - Hiểu biết PHP, JavaScript, Laravel 12 | - Biết sử dụng Composer, NPM. 13 | - PHP >= 8.1, MySQL. 14 | 15 | ### Cài đặt 16 | 17 | - Tải hoặc clone nhánh [production](https://github.com/datlechin/PolyCourse/tree/production) (đã chạy sẵn build assets) 18 | - Chạy `composer install` và `npm install` 19 | - Setup file `.env` và config database 20 | - Chạy lệnh `php artisan migrate` để chạy migrate và thêm `--seed` đằng sau nếu muốn tạo dữ liệu có sẵn. 21 | - Chạy `npm run dev` hoặc `npm run build` để build lại assets 22 | 23 | ### Sử dụng 24 | 25 | Truy cập vào link `domain/admin` để đăng nhập vào trang quản trị. 26 | Đăng nhập vào admin bằng bất kỳ tài khoản nào. 27 | 28 | ## Đóng góp 29 | 30 | Mọi đóng góp từ các bạn bằng cách tạo pull request đều được welcome! 31 | -------------------------------------------------------------------------------- /database/seeders/CourseRequirementSeeder.php: -------------------------------------------------------------------------------- 1 | requirements()->create([ 29 | 'text' => $requirement, 30 | ]); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2022_11_22_231218_create_lessons_table.php: -------------------------------------------------------------------------------- 1 | uuid('id')->primary(); 17 | $table->foreignIdFor(Course::class)->constrained(); 18 | $table->string('name'); 19 | $table->text('content')->nullable(); 20 | $table->string('youtube_id')->nullable(); 21 | $table->integer('time_duration')->default(0); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('lessons'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/seeders/CourseLearnGoalSeeder.php: -------------------------------------------------------------------------------- 1 | learnGoals()->create([ 29 | 'text' => $learnGoal, 30 | ]); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/js/helpers.js: -------------------------------------------------------------------------------- 1 | const dateFormat = (value , locale = 'vi-VN') => { 2 | const date = new Date(value) 3 | 4 | return new Intl.DateTimeFormat(locale).format(date) 5 | } 6 | 7 | const numberFormat = (number, locale = 'vi-VN', options = {}) => { 8 | return new Intl.NumberFormat(locale, options).format(number) 9 | } 10 | 11 | const priceFormat = (number, currency = 'VND') => { 12 | return numberFormat(number, 'vi-VN', { 13 | style: 'currency', 14 | currency: 'VND', 15 | }) 16 | } 17 | 18 | const secondsToTime = (number) => { 19 | let hours = Math.floor(number / 3600); 20 | let minutes = Math.floor(number % 3600 / 60); 21 | // let seconds = Math.floor(number % 3600 % 60); 22 | 23 | let hoursText = hours > 0 ? hours + ' giờ ' : ''; 24 | let minutesText = minutes > 0 ? minutes + ' phút ' : ''; 25 | // let secondsText = seconds > 0 ? seconds + ' giây ' : ''; 26 | return hoursText + minutesText; 27 | } 28 | 29 | export { numberFormat, dateFormat, priceFormat, secondsToTime } 30 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Filament/Widgets/RecentlySubscribedStudents.php: -------------------------------------------------------------------------------- 1 | with(['user', 'course']) 18 | ->latest(); 19 | } 20 | 21 | protected function getTableColumns(): array 22 | { 23 | return [ 24 | Tables\Columns\TextColumn::make('user.name') 25 | ->label('Học viên'), 26 | 27 | Tables\Columns\TextColumn::make('course.name') 28 | ->label('Khoá học'), 29 | 30 | Tables\Columns\TextColumn::make('created_at') 31 | ->label('Đăng ký lúc') 32 | ->since(), 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/js/components/PostList.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/LearningController.php: -------------------------------------------------------------------------------- 1 | where('slug', $course) 17 | ->with(['lessons', 'reviews' => function ($query) { 18 | $query->with('author')->latest(); 19 | }]) 20 | ->withWhereHas('lesson', function ($query) use ($lesson) { 21 | $query->where('id', $lesson); 22 | }) 23 | ->withExists(['reviews as is_reviewed' => function (Builder $query) { 24 | $query->where('user_id', Auth::id()); 25 | }]) 26 | ->firstOrFail(); 27 | 28 | return Inertia::render('Learning', [ 29 | 'course' => $course, 30 | ]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamp('expires_at')->nullable(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('personal_access_tokens'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_141834_create_posts_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(Category::class)->constrained(); 19 | $table->foreignIdFor(User::class)->constrained(); 20 | $table->string('title'); 21 | $table->string('slug')->unique(); 22 | $table->string('excerpt')->nullable(); 23 | $table->text('content'); 24 | $table->integer('views')->default(0); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('posts'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | 33 | /** 34 | * Determine if events and listeners should be automatically discovered. 35 | * 36 | * @return bool 37 | */ 38 | public function shouldDiscoverEvents() 39 | { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/js/components/PostItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 28 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('username')->unique(); 18 | $table->string('email')->unique(); 19 | $table->timestamp('email_verified_at')->nullable(); 20 | $table->string('password'); 21 | $table->string('phone')->unique()->nullable(); 22 | $table->text('bio')->nullable(); 23 | $table->string('avatar')->nullable(); 24 | $table->rememberToken(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | config('app.name'), 30 | 'auth.user' => fn () => $request->user() 31 | ? $request->user() 32 | : null, 33 | 'flash' => [ 34 | 'success' => fn () => $request->session()->get('success'), 35 | 'error' => fn () => $request->session()->get('error'), 36 | ], 37 | ]); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /resources/js/components/CourseList.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 34 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * Define the model's default state. 16 | * 17 | * @return array 18 | */ 19 | public function definition() 20 | { 21 | return [ 22 | 'name' => fake()->name(), 23 | 'email' => fake()->unique()->safeEmail(), 24 | 'email_verified_at' => Carbon::now(), 25 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 26 | 'remember_token' => Str::random(10), 27 | ]; 28 | } 29 | 30 | /** 31 | * Indicate that the model's email address should be unverified. 32 | * 33 | * @return static 34 | */ 35 | public function unverified() 36 | { 37 | return $this->state(fn (array $attributes) => [ 38 | 'email_verified_at' => null, 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_141841_create_courses_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(Category::class)->constrained(); 19 | $table->string('name'); 20 | $table->string('slug')->unique(); 21 | $table->string('subtitle', 300)->nullable(); 22 | $table->text('description')->nullable(); 23 | $table->string('level')->default(InstructionalLevel::All->value); 24 | $table->float('price')->default(0); 25 | $table->string('trailer')->nullable(); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | */ 33 | public function down(): void 34 | { 35 | Schema::dropIfExists('courses'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2022_11_09_142327_create_media_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 13 | 14 | $table->morphs('model'); 15 | $table->uuid('uuid')->nullable()->unique(); 16 | $table->string('collection_name'); 17 | $table->string('name'); 18 | $table->string('file_name'); 19 | $table->string('mime_type')->nullable(); 20 | $table->string('disk'); 21 | $table->string('conversions_disk')->nullable(); 22 | $table->unsignedBigInteger('size'); 23 | $table->json('manipulations'); 24 | $table->json('custom_properties'); 25 | $table->json('generated_conversions'); 26 | $table->json('responsive_images'); 27 | $table->unsignedInteger('order_column')->nullable()->index(); 28 | 29 | $table->nullableTimestamps(); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/RelationManagers/CoursesRelationManager.php: -------------------------------------------------------------------------------- 1 | columns([ 19 | TextColumn::make('name') 20 | ->label('Tên') 21 | ->searchable() 22 | ->sortable(), 23 | 24 | TextColumn::make('subtitle') 25 | ->limit(50) 26 | ->label('Mô tả'), 27 | 28 | TextColumn::make('price') 29 | ->formatStateUsing(fn (string $state): string => $state == 0 ? 'Miễn phí' : $state) 30 | ->label('Giá'), 31 | 32 | TextColumn::make('created_at') 33 | ->label('Tạo lúc'), 34 | ]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | $this->reportable(function (Throwable $e) { 47 | // 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/RelationManagers/PostsRelationManager.php: -------------------------------------------------------------------------------- 1 | columns([ 20 | SpatieMediaLibraryImageColumn::make('thumbnail') 21 | ->label('Hình ảnh'), 22 | 23 | TextColumn::make('user.name') 24 | ->label('Người ') 25 | ->searchable() 26 | ->sortable(), 27 | 28 | TextColumn::make('title') 29 | ->label('Tiêu đề') 30 | ->searchable() 31 | ->sortable(), 32 | 33 | TextColumn::make('views') 34 | ->label('Lượt xem') 35 | ->formatStateUsing(fn (string $state): string => number_format($state)), 36 | ]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/seeders/LearningPathSeeder.php: -------------------------------------------------------------------------------- 1 | 'Lộ trình học Front-end', 21 | 'description' => 'Lập trình viên Front-end là người xây dựng ra giao diện websites. Trong phần này F8 sẽ chia sẻ cho bạn lộ trình để trở thành lập trình viên Front-end nhé.', 22 | ], 23 | [ 24 | 'name' => 'Lộ trình học Back-end', 25 | 'description' => 'Trái với Front-end thì lập trình viên Back-end là người làm việc với dữ liệu, công việc thường nặng tính logic hơn. Chúng ta sẽ cùng tìm hiểu thêm về lộ trình học Back-end nhé.', 26 | ], 27 | ]; 28 | 29 | foreach ($learningPaths as $key => $learningPath) { 30 | LearningPath::create([ 31 | ...$learningPath, 32 | 'slug' => Str::slug($learningPath['name']), 33 | 'content' => fake()->realText(500), 34 | ]) 35 | ->addMediaFromDisk('learning-paths/'.$key + 1 .'.png', 'public') 36 | ->toMediaCollection('learning-paths'); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_TABLE_PREFIX= 12 | DB_CONNECTION=mysql 13 | DB_HOST=127.0.0.1 14 | DB_PORT=3306 15 | DB_DATABASE=pro1014 16 | DB_USERNAME=root 17 | DB_PASSWORD= 18 | 19 | BROADCAST_DRIVER=log 20 | CACHE_DRIVER=file 21 | FILESYSTEM_DISK=local 22 | QUEUE_CONNECTION=sync 23 | SESSION_DRIVER=file 24 | SESSION_LIFETIME=120 25 | 26 | MEMCACHED_HOST=127.0.0.1 27 | 28 | REDIS_HOST=127.0.0.1 29 | REDIS_PASSWORD=null 30 | REDIS_PORT=6379 31 | 32 | MAIL_MAILER=smtp 33 | MAIL_HOST=mailhog 34 | MAIL_PORT=1025 35 | MAIL_USERNAME=null 36 | MAIL_PASSWORD=null 37 | MAIL_ENCRYPTION=null 38 | MAIL_FROM_ADDRESS="hello@example.com" 39 | MAIL_FROM_NAME="${APP_NAME}" 40 | 41 | AWS_ACCESS_KEY_ID= 42 | AWS_SECRET_ACCESS_KEY= 43 | AWS_DEFAULT_REGION=us-east-1 44 | AWS_BUCKET= 45 | AWS_USE_PATH_STYLE_ENDPOINT=false 46 | 47 | PUSHER_APP_ID= 48 | PUSHER_APP_KEY= 49 | PUSHER_APP_SECRET= 50 | PUSHER_HOST= 51 | PUSHER_PORT=443 52 | PUSHER_SCHEME=https 53 | PUSHER_APP_CLUSTER=mt1 54 | 55 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 56 | VITE_PUSHER_HOST="${PUSHER_HOST}" 57 | VITE_PUSHER_PORT="${PUSHER_PORT}" 58 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 59 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 60 | 61 | GITHUB_CLIENT_ID= 62 | GITHUB_CLIENT_SECRET= 63 | 64 | TWITTER_API_KEY= 65 | TWITTER_API_SECRET= 66 | 67 | FACEBOOK_APP_ID= 68 | FACEBOOK_APP_SECRET= 69 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | uploadFiles('posts'); 20 | $this->uploadFiles('courses'); 21 | $this->uploadFiles('learning-paths'); 22 | 23 | $this->call([ 24 | UserSeeder::class, 25 | CategorySeeder::class, 26 | PostSeeder::class, 27 | CourseSeeder::class, 28 | LessonSeeder::class, 29 | CourseRequirementSeeder::class, 30 | CourseLearnGoalSeeder::class, 31 | LearningPathSeeder::class, 32 | ReviewSeeder::class, 33 | ]); 34 | } 35 | 36 | protected function uploadFiles(string $folder): void 37 | { 38 | $path = database_path('seeders/files/'.$folder); 39 | 40 | if (! is_dir($path)) { 41 | return; 42 | } 43 | 44 | $files = scandir($path); 45 | 46 | foreach ($files as $file) { 47 | if (in_array($file, ['.', '..'])) { 48 | continue; 49 | } 50 | 51 | Storage::disk('public')->putFileAs($folder, new SplFileInfo($path.'/'.$file), $file); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /resources/js/components/LearningLayout.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 42 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | 41 | /** 42 | * Configure the rate limiters for the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configureRateLimiting() 47 | { 48 | RateLimiter::for('api', function (Request $request) { 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /database/seeders/UserSeeder.php: -------------------------------------------------------------------------------- 1 | 'Ngô Quốc Đạt', 22 | 'username' => 'quocdat', 23 | 'email' => 'datnqpd05994@fpt.edu.vn', 24 | ], 25 | [ 26 | 'name' => 'Huỳnh Kim Phú', 27 | 'username' => 'kimphu', 28 | 'email' => 'phuhkps25439@fpt.edu.vn', 29 | ], 30 | [ 31 | 'name' => 'Nguyễn Đức Lập', 32 | 'username' => 'duclap', 33 | 'email' => 'lapndps24157@fpt.edu.vn', 34 | ], 35 | [ 36 | 'name' => 'Phạm Ngọc Đạt', 37 | 'username' => 'ngocdat', 38 | 'email' => 'datpnps24143@fpt.edu.vn', 39 | ], 40 | ]; 41 | 42 | foreach ($users as $user) { 43 | User::create([ 44 | ...$user, 45 | 'password' => Hash::make('123456'), 46 | 'phone' => fake()->e164PhoneNumber(), 47 | 'bio' => fake()->realText(), 48 | 'email_verified_at' => Carbon::now(), 49 | ]); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /resources/js/components/ReviewItem.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 43 | -------------------------------------------------------------------------------- /resources/js/Pages/LearningPaths/Index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 35 | -------------------------------------------------------------------------------- /app/Models/Post.php: -------------------------------------------------------------------------------- 1 | 'integer', 28 | ]; 29 | 30 | protected $appends = [ 31 | 'thumbnail_url', 32 | 'read_duration', 33 | ]; 34 | 35 | public function author(): BelongsTo 36 | { 37 | return $this->belongsTo(User::class, 'user_id'); 38 | } 39 | 40 | public function category(): BelongsTo 41 | { 42 | return $this->belongsTo(Category::class); 43 | } 44 | 45 | public function scopePopular(Builder $query): Builder 46 | { 47 | return $query->orderByDesc('views'); 48 | } 49 | 50 | protected function thumbnailUrl(): Attribute 51 | { 52 | return Attribute::make( 53 | get: fn (): string => $this->getFirstMediaUrl('posts'), 54 | ); 55 | } 56 | 57 | protected function readDuration(): Attribute 58 | { 59 | return Attribute::make( 60 | get: fn () => max(1, round(str_word_count($this->content) / 200)) 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | 'facebook' => [ 35 | 'client_id' => env('FACEBOOK_APP_ID'), 36 | 'client_secret' => env('FACEBOOK_APP_SECRET'), 37 | 'redirect' => '', 38 | ], 39 | 40 | 'twitter' => [ 41 | 'client_id' => env('TWITTER_API_KEY'), 42 | 'client_secret' => env('TWITTER_API_SECRET'), 43 | 'redirect' => '', 44 | ], 45 | 46 | 'github' => [ 47 | 'client_id' => env('GITHUB_CLIENT_ID'), 48 | 'client_secret' => env('GITHUB_CLIENT_SECRET'), 49 | 'redirect' => '', 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /resources/js/components/Sidebar.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 53 | -------------------------------------------------------------------------------- /resources/js/Pages/Blog/Show.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 45 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # For more information: https://laravel.com/docs/sail 2 | version: '3' 3 | services: 4 | laravel.test: 5 | build: 6 | context: ./vendor/laravel/sail/runtimes/8.1 7 | dockerfile: Dockerfile 8 | args: 9 | WWWGROUP: '${WWWGROUP}' 10 | image: sail-8.1/app 11 | extra_hosts: 12 | - 'host.docker.internal:host-gateway' 13 | ports: 14 | - '${APP_PORT:-80}:80' 15 | - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' 16 | environment: 17 | WWWUSER: '${WWWUSER}' 18 | LARAVEL_SAIL: 1 19 | XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' 20 | XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' 21 | volumes: 22 | - '.:/var/www/html' 23 | networks: 24 | - sail 25 | depends_on: 26 | - mysql 27 | mysql: 28 | image: 'mysql/mysql-server:8.0' 29 | ports: 30 | - '${FORWARD_DB_PORT:-3306}:3306' 31 | environment: 32 | MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' 33 | MYSQL_ROOT_HOST: "%" 34 | MYSQL_DATABASE: '${DB_DATABASE}' 35 | MYSQL_USER: '${DB_USERNAME}' 36 | MYSQL_PASSWORD: '${DB_PASSWORD}' 37 | MYSQL_ALLOW_EMPTY_PASSWORD: 1 38 | volumes: 39 | - 'sail-mysql:/var/lib/mysql' 40 | - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' 41 | networks: 42 | - sail 43 | healthcheck: 44 | test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"] 45 | retries: 3 46 | timeout: 5s 47 | networks: 48 | sail: 49 | driver: bridge 50 | volumes: 51 | sail-mysql: 52 | driver: local 53 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/SocialiteController.php: -------------------------------------------------------------------------------- 1 | set('services.facebook.redirect', route('socialite.callback', $provider)); 20 | } 21 | 22 | public function redirect(string $provider): RedirectResponse 23 | { 24 | $this->setConfig($provider); 25 | 26 | return Socialite::driver($provider)->redirect(); 27 | } 28 | 29 | public function callback(string $provider): RedirectResponse 30 | { 31 | $this->setConfig($provider); 32 | 33 | $providerUser = Socialite::driver($provider)->user(); 34 | 35 | $socialAccount = SocialAccount::firstOrNew( 36 | ['provider_id' => $providerUser->getId(), 'provider_name' => $provider], 37 | ['token' => $providerUser->token] 38 | ); 39 | 40 | $user = User::updateOrCreate( 41 | ['email' => $providerUser->getEmail()], 42 | [ 43 | 'name' => $providerUser->getName() ?: $providerUser->getEmail(), 44 | 'username' => $providerUser->getNickname(), 45 | 'avatar' => $providerUser->getAvatar(), 46 | 'email_verified_at' => Carbon::now(), 47 | 'password' => Hash::make(Str::random(32)), 48 | ] 49 | ); 50 | 51 | $socialAccount->user()->associate($user); 52 | $socialAccount->save(); 53 | 54 | Auth::login($user); 55 | 56 | return to_route('home'); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /resources/js/components/SocialLoginList.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 53 | -------------------------------------------------------------------------------- /app/Models/Course.php: -------------------------------------------------------------------------------- 1 | 'integer', 32 | ]; 33 | 34 | protected $appends = [ 35 | 'thumbnail_url', 36 | ]; 37 | 38 | public function category(): BelongsTo 39 | { 40 | return $this->belongsTo(Category::class); 41 | } 42 | 43 | public function learnGoals(): HasMany 44 | { 45 | return $this->hasMany(CourseLearnGoal::class); 46 | } 47 | 48 | public function requirements(): HasMany 49 | { 50 | return $this->hasMany(CourseRequirement::class); 51 | } 52 | 53 | public function lessons(): HasMany 54 | { 55 | return $this->hasMany(Lesson::class); 56 | } 57 | 58 | public function lesson(): HasOne 59 | { 60 | return $this->hasOne(Lesson::class); 61 | } 62 | 63 | public function students(): BelongsToMany 64 | { 65 | return $this->belongsToMany(User::class)->withTimestamps(); 66 | } 67 | 68 | public function reviews(): MorphMany 69 | { 70 | return $this->morphMany(Review::class, 'reviewable'); 71 | } 72 | 73 | protected function thumbnailUrl(): Attribute 74 | { 75 | return Attribute::make( 76 | get: fn () => $this->getFirstMediaUrl('courses'), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 40 | 'port' => env('PUSHER_PORT', 443), 41 | 'scheme' => env('PUSHER_SCHEME', 'https'), 42 | 'encrypted' => true, 43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 44 | ], 45 | 'client_options' => [ 46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 47 | ], 48 | ], 49 | 50 | 'ably' => [ 51 | 'driver' => 'ably', 52 | 'key' => env('ABLY_KEY'), 53 | ], 54 | 55 | 'redis' => [ 56 | 'driver' => 'redis', 57 | 'connection' => 'default', 58 | ], 59 | 60 | 'log' => [ 61 | 'driver' => 'log', 62 | ], 63 | 64 | 'null' => [ 65 | 'driver' => 'null', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/js/Pages/Blog/Index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 53 | -------------------------------------------------------------------------------- /app/Http/Controllers/CourseController.php: -------------------------------------------------------------------------------- 1 | with('media') 19 | ->withCount('students') 20 | ->latest() 21 | ->get(); 22 | 23 | return Inertia::render('Courses/Index', [ 24 | 'courses' => $courses, 25 | ]); 26 | } 27 | 28 | public function show(string $slug): Response|RedirectResponse 29 | { 30 | $course = Course::query() 31 | ->where('slug', $slug) 32 | ->with(['lessons', 'learnGoals', 'requirements']) 33 | ->withSum('lessons as lessons_time_duration', 'time_duration') 34 | ->withCount('lessons') 35 | ->withExists(['students as is_enrolled' => function (Builder $query) { 36 | $query->where('user_id', Auth::id()); 37 | }]) 38 | ->firstOrFail(); 39 | 40 | if ($course->is_enrolled) { 41 | return to_route('learning', ['course' => $course->slug, 'lesson' => $course->lessons->first()]); 42 | } 43 | 44 | return Inertia::render('Courses/Show', [ 45 | 'course' => $course, 46 | ]); 47 | } 48 | 49 | public function subscribe(Request $request, string $slug): RedirectResponse 50 | { 51 | $user = $request->user(); 52 | $course = Course::query() 53 | ->where('slug', $slug) 54 | ->with('lesson', function ($query) { 55 | $query->oldest(); 56 | }) 57 | ->withExists(['students as is_enrolled' => function (Builder $query) { 58 | $query->where('user_id', Auth::id()); 59 | }]) 60 | ->firstOrFail(); 61 | 62 | if ($course->is_enrolled) { 63 | return to_route('learning', ['course' => $course, 'lesson' => $course->lesson]); 64 | } 65 | 66 | $course->students()->attach($user); 67 | 68 | return to_route('learning', ['course' => $course, 'lesson' => $course->lesson])->with('success', 'Đăng ký khoá học thành công'); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 51 | ]; 52 | 53 | protected $appends = [ 54 | 'avatar_url', 55 | ]; 56 | 57 | public function canAccessFilament(): bool 58 | { 59 | return true; 60 | } 61 | 62 | public function getFilamentAvatarUrl(): ?string 63 | { 64 | return $this->avatar_url; 65 | } 66 | 67 | public function posts(): HasMany 68 | { 69 | return $this->hasMany(Post::class); 70 | } 71 | 72 | public function courses(): BelongsToMany 73 | { 74 | return $this->belongsToMany(Course::class, 'course_user'); 75 | } 76 | 77 | public function socialAccounts(): HasMany 78 | { 79 | return $this->hasMany(SocialAccount::class); 80 | } 81 | 82 | public function reviews(): HasMany 83 | { 84 | return $this->hasMany(Review::class); 85 | } 86 | 87 | protected function avatarUrl(): Attribute 88 | { 89 | return Attribute::make( 90 | get: fn () => 'https://ui-avatars.com/api/?name='.urlencode($this->name), 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /resources/js/Pages/Profile.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 54 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.1", 9 | "filament/filament": "^2.16.55", 10 | "filament/spatie-laravel-media-library-plugin": "^2.16.55", 11 | "guzzlehttp/guzzle": "^7.5", 12 | "inertiajs/inertia-laravel": "^0.6.4", 13 | "laravel/framework": "^10.14.1", 14 | "laravel/sanctum": "^3.0.1", 15 | "laravel/socialite": "^5.5.6", 16 | "laravel/tinker": "^2.7.3", 17 | "spatie/laravel-medialibrary": "^10.7.4", 18 | "tightenco/ziggy": "^1.5" 19 | }, 20 | "require-dev": { 21 | "barryvdh/laravel-debugbar": "^3.7", 22 | "fakerphp/faker": "^1.20", 23 | "laravel-lang/attributes": "^2.0.9", 24 | "laravel-lang/lang": "^12.6", 25 | "laravel-lang/publisher": "^14.4", 26 | "laravel/pint": "^1.2.1", 27 | "laravel/sail": "^1.16.3", 28 | "mockery/mockery": "^1.5.1", 29 | "nunomaduro/collision": "^7.7.0", 30 | "phpunit/phpunit": "^10.2.4", 31 | "spatie/laravel-ignition": "^2.2.0" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "App\\": "app/", 36 | "Database\\Factories\\": "database/factories/", 37 | "Database\\Seeders\\": "database/seeders/" 38 | } 39 | }, 40 | "autoload-dev": { 41 | "psr-4": { 42 | "Tests\\": "tests/" 43 | } 44 | }, 45 | "scripts": { 46 | "post-autoload-dump": [ 47 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 48 | "@php artisan package:discover --ansi" 49 | ], 50 | "post-update-cmd": [ 51 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force", 52 | "@php artisan filament:upgrade" 53 | ], 54 | "post-root-package-install": [ 55 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 56 | ], 57 | "post-create-project-cmd": [ 58 | "@php artisan key:generate --ansi" 59 | ] 60 | }, 61 | "extra": { 62 | "laravel": { 63 | "dont-discover": [] 64 | } 65 | }, 66 | "config": { 67 | "optimize-autoloader": true, 68 | "preferred-install": "dist", 69 | "sort-packages": true, 70 | "allow-plugins": { 71 | "pestphp/pest-plugin": true 72 | } 73 | }, 74 | "minimum-stability": "dev", 75 | "prefer-stable": true 76 | } 77 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "(and :count more error)": "(and :count more error)", 3 | "(and :count more errors)": "(and :count more errors)", 4 | "All rights reserved.": "All rights reserved.", 5 | "Forbidden": "Forbidden", 6 | "Go to page :page": "Go to page :page", 7 | "Hello!": "Hello!", 8 | "If you did not create an account, no further action is required.": "If you did not create an account, no further action is required.", 9 | "If you did not request a password reset, no further action is required.": "If you did not request a password reset, no further action is required.", 10 | "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:", 11 | "Login": "Login", 12 | "Logout": "Logout", 13 | "Not Found": "Not Found", 14 | "of": "of", 15 | "Page Expired": "Page Expired", 16 | "Pagination Navigation": "Pagination Navigation", 17 | "Please click the button below to verify your email address.": "Please click the button below to verify your email address.", 18 | "Regards": "Regards", 19 | "Register": "Register", 20 | "Reset Password": "Reset Password", 21 | "Reset Password Notification": "Reset Password Notification", 22 | "results": "results", 23 | "Server Error": "Server Error", 24 | "Service Unavailable": "Service Unavailable", 25 | "Showing": "Showing", 26 | "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", 27 | "The :attribute must contain at least one number.": "The :attribute must contain at least one number.", 28 | "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", 29 | "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", 30 | "The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute.", 31 | "The given data was invalid.": "The given data was invalid.", 32 | "This password reset link will expire in :count minutes.": "This password reset link will expire in :count minutes.", 33 | "to": "to", 34 | "Toggle navigation": "Toggle navigation", 35 | "Too Many Requests": "Too Many Requests", 36 | "Unauthorized": "Unauthorized", 37 | "Verify Email Address": "Verify Email Address", 38 | "Whoops!": "Whoops!", 39 | "You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account." 40 | } -------------------------------------------------------------------------------- /lang/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "(and :count more error)": "(và :count lỗi khác)", 3 | "(and :count more errors)": "(và :count lỗi khác)", 4 | "All rights reserved.": "Đã đăng kí bản quyền", 5 | "Forbidden": "Cấm Truy Cập", 6 | "Go to page :page": "Tới trang :page", 7 | "Hello!": "Xin chào!", 8 | "If you did not create an account, no further action is required.": "Nếu bạn không đăng ký tài khoản này, bạn không cần thực hiện thêm hành động nào.", 9 | "If you did not request a password reset, no further action is required.": "Nếu bạn không yêu cầu đặt lại mật khẩu, bạn không cần thực hiện thêm hành động nào.", 10 | "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Nếu bạn gặp vấn đề khi click vào nút \":actionText\", hãy sao chép dán địa chỉ bên dưới\nvào trình duyệt web của bạn:", 11 | "Login": "Đăng nhập", 12 | "Logout": "Đăng xuất", 13 | "Not Found": "Không Tìm Thấy", 14 | "of": "trong", 15 | "Page Expired": "Trang Đã Hết Hạn", 16 | "Pagination Navigation": "Điều hướng phân trang", 17 | "Please click the button below to verify your email address.": "Vui lòng click vào nút bên dưới để xác minh địa chỉ email của bạn.", 18 | "Regards": "Trân trọng", 19 | "Register": "Đăng ký", 20 | "Reset Password": "Đặt Lại Mật Khẩu", 21 | "Reset Password Notification": "Thông Báo Đặt Lại Mật Khẩu", 22 | "results": "kết quả", 23 | "Server Error": "Máy Chủ Gặp Sự Cố", 24 | "Service Unavailable": "Dịch Vụ Không Khả Dụng", 25 | "Showing": "Đang hiển thị", 26 | "The :attribute must contain at least one letter.": "Trường :attribute phải chứa ít nhất một chữ cái.", 27 | "The :attribute must contain at least one number.": "Trường :attribute phải chứa ít nhất một số.", 28 | "The :attribute must contain at least one symbol.": "Trường :attribute must phải chứa ít nhất một ký hiệu.", 29 | "The :attribute must contain at least one uppercase and one lowercase letter.": "Trường :attribute phải chứa ít nhất một chữ hoa và một chữ thường.", 30 | "The given :attribute has appeared in a data leak. Please choose a different :attribute.": ":Attribute đã cho đã xuất hiện trong một vụ rò rỉ dữ liệu. Vui lòng chọn :attribute khác.", 31 | "The given data was invalid.": "Dữ liệu nhận được không hợp lệ.", 32 | "This password reset link will expire in :count minutes.": "Đường dẫn lấy lại mật khẩu sẽ hết hạn trong :count phút.", 33 | "to": "tới", 34 | "Toggle navigation": "Chuyển hướng điều hướng", 35 | "Too Many Requests": "Quá Nhiều Yêu Cầu", 36 | "Unauthorized": "Không Được Phép", 37 | "Verify Email Address": "Xác Minh Địa Chỉ Email", 38 | "Whoops!": "Rất tiếc!", 39 | "You are receiving this email because we received a password reset request for your account.": "Bạn nhận được email này vì chúng tôi đã nhận được yêu cầu đặt lại mật khẩu cho tài khoản của bạn." 40 | } -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | \App\Http\Middleware\HandleInertiaRequests::class, 40 | ], 41 | 42 | 'api' => [ 43 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 44 | 'throttle:api', 45 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 46 | ], 47 | ]; 48 | 49 | /** 50 | * The application's route middleware. 51 | * 52 | * These middleware may be assigned to groups or used individually. 53 | * 54 | * @var array 55 | */ 56 | protected $routeMiddleware = [ 57 | 'auth' => \App\Http\Middleware\Authenticate::class, 58 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 59 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 60 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 61 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 62 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 63 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 64 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /resources/js/components/ReviewForm.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 |