├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── README.md ├── app ├── Article.php ├── Category.php ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── FaqCategory.php ├── FaqQuestion.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── ArticlesController.php │ │ │ ├── CategoriesController.php │ │ │ ├── FaqCategoryController.php │ │ │ ├── FaqQuestionController.php │ │ │ ├── HomeController.php │ │ │ ├── PermissionsController.php │ │ │ ├── RolesController.php │ │ │ ├── TagsController.php │ │ │ └── UsersController.php │ │ ├── Api │ │ │ └── V1 │ │ │ │ └── Admin │ │ │ │ ├── ArticlesApiController.php │ │ │ │ ├── CategoriesApiController.php │ │ │ │ ├── FaqCategoryApiController.php │ │ │ │ ├── FaqQuestionApiController.php │ │ │ │ ├── PermissionsApiController.php │ │ │ │ ├── RolesApiController.php │ │ │ │ ├── TagsApiController.php │ │ │ │ └── UsersApiController.php │ │ ├── ArticleController.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── VerificationController.php │ │ ├── CategoryController.php │ │ ├── Controller.php │ │ ├── FaqController.php │ │ ├── HomeController.php │ │ └── TagController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── AuthGates.php │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── SetLocale.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ ├── MassDestroyArticleRequest.php │ │ ├── MassDestroyCategoryRequest.php │ │ ├── MassDestroyFaqCategoryRequest.php │ │ ├── MassDestroyFaqQuestionRequest.php │ │ ├── MassDestroyPermissionRequest.php │ │ ├── MassDestroyRoleRequest.php │ │ ├── MassDestroyTagRequest.php │ │ ├── MassDestroyUserRequest.php │ │ ├── StoreArticleRequest.php │ │ ├── StoreCategoryRequest.php │ │ ├── StoreFaqCategoryRequest.php │ │ ├── StoreFaqQuestionRequest.php │ │ ├── StorePermissionRequest.php │ │ ├── StoreRoleRequest.php │ │ ├── StoreTagRequest.php │ │ ├── StoreUserRequest.php │ │ ├── UpdateArticleRequest.php │ │ ├── UpdateCategoryRequest.php │ │ ├── UpdateFaqCategoryRequest.php │ │ ├── UpdateFaqQuestionRequest.php │ │ ├── UpdatePermissionRequest.php │ │ ├── UpdateRoleRequest.php │ │ ├── UpdateTagRequest.php │ │ └── UpdateUserRequest.php │ ├── Resources │ │ └── Admin │ │ │ ├── ArticleResource.php │ │ │ ├── CategoryResource.php │ │ │ ├── FaqCategoryResource.php │ │ │ ├── FaqQuestionResource.php │ │ │ ├── PermissionResource.php │ │ │ ├── RoleResource.php │ │ │ ├── TagResource.php │ │ │ └── UserResource.php │ └── View │ │ └── Composers │ │ └── LayoutComposer.php ├── Permission.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Role.php ├── Tag.php └── User.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── panel.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_10_11_000001_create_permissions_table.php │ ├── 2019_10_11_000002_create_roles_table.php │ ├── 2019_10_11_000003_create_users_table.php │ ├── 2019_10_11_000004_create_categories_table.php │ ├── 2019_10_11_000005_create_tags_table.php │ ├── 2019_10_11_000006_create_articles_table.php │ ├── 2019_10_11_000007_create_faq_categories_table.php │ ├── 2019_10_11_000008_create_faq_questions_table.php │ ├── 2019_10_11_000009_create_permission_role_pivot_table.php │ ├── 2019_10_11_000010_create_role_user_pivot_table.php │ ├── 2019_10_11_000012_create_article_tag_pivot_table.php │ ├── 2019_10_11_000013_add_relationship_fields_to_faq_questions_table.php │ ├── 2019_10_13_092522_add_views_count_to_articles_table.php │ └── 2019_10_14_141550_add_slug_to_multiple_tables.php └── seeds │ ├── ArticlesTableSeeder.php │ ├── CategoriesTableSeeder.php │ ├── DatabaseSeeder.php │ ├── FaqsTableSeeder.php │ ├── PermissionRoleTableSeeder.php │ ├── PermissionsTableSeeder.php │ ├── RoleUserTableSeeder.php │ ├── RolesTableSeeder.php │ ├── TagsTableSeeder.php │ └── UsersTableSeeder.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── bootstrap.css │ ├── custom.css │ ├── font-awesome.min.css │ └── style.css ├── favicon.ico ├── fonts │ ├── FontAwesome.otf │ ├── droid-serif │ │ ├── Apache License.txt │ │ ├── DroidSerif-Bold.ttf │ │ ├── DroidSerif-BoldItalic.ttf │ │ ├── DroidSerif-Italic.ttf │ │ └── DroidSerif-Regular.ttf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ └── ufonts.com_copperplate-gothic-regular.ttf ├── images │ ├── 404.png │ ├── article-images │ │ ├── bnw.jpg │ │ ├── ipad.jpg │ │ └── write.jpg │ ├── blogimgbig.jpg │ ├── blogimgthumb.jpg │ ├── helpdesk-icon.png │ ├── listarrow.png │ ├── logo.png │ ├── page-headers │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ └── 9.jpg │ ├── search.png │ ├── searchicon.gif │ ├── template_pic.jpg │ ├── user.png │ └── videoicon.png ├── index.php ├── js │ ├── app.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-2.2.4.min.js │ ├── main.js │ └── npm.js └── robots.txt ├── resources ├── js │ ├── app.js │ └── bootstrap.js ├── lang │ └── en │ │ ├── auth.php │ │ ├── cruds.php │ │ ├── global.php │ │ ├── pagination.php │ │ ├── panel.php │ │ ├── passwords.php │ │ └── validation.php ├── sass │ └── app.scss └── views │ ├── admin │ ├── articles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── categories │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── faqCategories │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── faqQuestions │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── home.blade.php │ ├── partials │ │ └── menu.blade.php │ ├── permissions │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── roles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── tags │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ └── users │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── articles │ ├── index.blade.php │ └── show.blade.php │ ├── auth │ ├── login.blade.php │ └── passwords │ │ ├── email.blade.php │ │ └── reset.blade.php │ ├── categories │ ├── index.blade.php │ └── show.blade.php │ ├── errors │ └── 404.blade.php │ ├── faq.blade.php │ ├── index.blade.php │ ├── layouts │ ├── admin.blade.php │ ├── app.blade.php │ └── main.blade.php │ ├── partials │ ├── footer.blade.php │ ├── nav.blade.php │ ├── pagination.blade.php │ └── sidebar.blade.php │ └── tags │ └── show.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── Browser │ ├── ArticlesTest.php │ ├── CategoriesTest.php │ ├── FaqCategoryTest.php │ ├── FaqQuestionTest.php │ ├── PermissionsTest.php │ ├── RolesTest.php │ ├── TagsTest.php │ └── UsersTest.php ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php ├── Unit │ └── ExampleTest.php └── bootstrap.php ├── webpack.mix.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME="Knowledge Base" 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=laravel 13 | DB_USERNAME=root 14 | DB_PASSWORD= 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.backup 8 | .phpunit.result.cache 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | .idea/ -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - unused_use 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel 8 Knowledge Base FAQ with Adminpanel 2 | 3 | Transformed [free Bootstrap theme](https://github.com/sunnyg1210/bootstrapKnowledgeBaseTheme) into fully manageable Laravel 8 project with adminpanel generated with [QuickAdminPanel](https://quickadminpanel.com), 4 | to manage all the articles, categories. 5 | 6 | Also added SEO important stuff like Articles Slugs in URLs. 7 | 8 | Demo video: [Youtube](https://www.youtube.com/watch?v=S2RRJqqvHEI) 9 | 10 | - - - - - 11 | 12 | ## Front-side Screenshots 13 | 14 | ![Laravel Knowledge Base FAQ Home](https://laraveldaily.com/wp-content/uploads/2019/10/Screen-Shot-2019-10-16-at-6.25.56-PM.png) 15 | 16 | - - - - - 17 | 18 | ![Laravel Knowledge Base FAQ Category](https://laraveldaily.com/wp-content/uploads/2019/10/Screen-Shot-2019-10-16-at-6.26.09-PM.png) 19 | 20 | - - - - - 21 | 22 | ## Adminpanel Screenshots 23 | 24 | ![Laravel Knowledge Base FAQ adminpanel articles](https://laraveldaily.com/wp-content/uploads/2019/10/Screen-Shot-2019-10-16-at-6.26.58-PM.png) 25 | 26 | ![Laravel Knowledge Base FAQ adminpanel new article](https://laraveldaily.com/wp-content/uploads/2019/10/Screen-Shot-2019-10-16-at-6.27.12-PM.png) 27 | 28 | - Front-end part is taken from [Bootstrap Knowledge Base Theme](https://github.com/sunnyg1210/bootstrapKnowledgeBaseTheme) and transformed into Laravel Blade and assets. 29 | - Admin part is fully generated with [QuickAdminPanel](https://2019.quickadminpanel.com). 30 | 31 | --- 32 | 33 | ## How to use 34 | 35 | - Clone the repository with __git clone__ 36 | - Copy __.env.example__ file to __.env__ and edit database credentials there 37 | - Run __composer install__ 38 | - Run __php artisan key:generate__ 39 | - Run __php artisan migrate --seed__ (it has some seeded data for your testing) 40 | - That's it: launch the main URL. 41 | - You can login to adminpanel by going go `/login` URL and login with credentials __admin@admin.com__ - __password__ 42 | 43 | ## License 44 | 45 | Basically, feel free to use and re-use any way you want. 46 | 47 | --- 48 | 49 | ## More from our LaravelDaily Team 50 | 51 | - Check out our adminpanel generator [QuickAdminPanel](https://quickadminpanel.com) 52 | - Read our [Blog with Laravel Tutorials](https://laraveldaily.com) 53 | - FREE E-book: [50 Laravel Quick Tips (and counting)](https://laraveldaily.com/free-e-book-40-laravel-quick-tips-and-counting/) 54 | - Subscribe to our [YouTube channel Laravel Business](https://www.youtube.com/channel/UCTuplgOBi6tJIlesIboymGA) 55 | - Enroll in our [Laravel Online Courses](https://laraveldaily.teachable.com/) 56 | -------------------------------------------------------------------------------- /app/Article.php: -------------------------------------------------------------------------------- 1 | belongsTo(Category::class); 36 | } 37 | 38 | public function tags() 39 | { 40 | return $this->belongsToMany(Tag::class); 41 | } 42 | 43 | public function sluggable() 44 | { 45 | return [ 46 | 'slug' => [ 47 | 'source' => 'title' 48 | ] 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Category.php: -------------------------------------------------------------------------------- 1 | hasMany(Article::class); 32 | } 33 | 34 | public function sluggable() 35 | { 36 | return [ 37 | 'slug' => [ 38 | 'source' => 'name' 39 | ] 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | hasMany(FaqQuestion::class, 'category_id', 'id'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/FaqQuestion.php: -------------------------------------------------------------------------------- 1 | belongsTo(FaqCategory::class, 'category_id'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/CategoriesController.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.categories.index'); 37 | } 38 | 39 | public function edit(Category $category) 40 | { 41 | abort_if(Gate::denies('category_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 42 | 43 | return view('admin.categories.edit', compact('category')); 44 | } 45 | 46 | public function update(UpdateCategoryRequest $request, Category $category) 47 | { 48 | $category->update($request->all()); 49 | 50 | return redirect()->route('admin.categories.index'); 51 | } 52 | 53 | public function show(Category $category) 54 | { 55 | abort_if(Gate::denies('category_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 56 | 57 | return view('admin.categories.show', compact('category')); 58 | } 59 | 60 | public function destroy(Category $category) 61 | { 62 | abort_if(Gate::denies('category_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 63 | 64 | $category->delete(); 65 | 66 | return back(); 67 | } 68 | 69 | public function massDestroy(MassDestroyCategoryRequest $request) 70 | { 71 | Category::whereIn('id', request('ids'))->delete(); 72 | 73 | return response(null, Response::HTTP_NO_CONTENT); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/FaqCategoryController.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.faq-categories.index'); 37 | } 38 | 39 | public function edit(FaqCategory $faqCategory) 40 | { 41 | abort_if(Gate::denies('faq_category_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 42 | 43 | return view('admin.faqCategories.edit', compact('faqCategory')); 44 | } 45 | 46 | public function update(UpdateFaqCategoryRequest $request, FaqCategory $faqCategory) 47 | { 48 | $faqCategory->update($request->all()); 49 | 50 | return redirect()->route('admin.faq-categories.index'); 51 | } 52 | 53 | public function show(FaqCategory $faqCategory) 54 | { 55 | abort_if(Gate::denies('faq_category_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 56 | 57 | return view('admin.faqCategories.show', compact('faqCategory')); 58 | } 59 | 60 | public function destroy(FaqCategory $faqCategory) 61 | { 62 | abort_if(Gate::denies('faq_category_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 63 | 64 | $faqCategory->delete(); 65 | 66 | return back(); 67 | } 68 | 69 | public function massDestroy(MassDestroyFaqCategoryRequest $request) 70 | { 71 | FaqCategory::whereIn('id', request('ids'))->delete(); 72 | 73 | return response(null, Response::HTTP_NO_CONTENT); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/HomeController.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.permissions.index'); 37 | } 38 | 39 | public function edit(Permission $permission) 40 | { 41 | abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 42 | 43 | return view('admin.permissions.edit', compact('permission')); 44 | } 45 | 46 | public function update(UpdatePermissionRequest $request, Permission $permission) 47 | { 48 | $permission->update($request->all()); 49 | 50 | return redirect()->route('admin.permissions.index'); 51 | } 52 | 53 | public function show(Permission $permission) 54 | { 55 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 56 | 57 | return view('admin.permissions.show', compact('permission')); 58 | } 59 | 60 | public function destroy(Permission $permission) 61 | { 62 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 63 | 64 | $permission->delete(); 65 | 66 | return back(); 67 | } 68 | 69 | public function massDestroy(MassDestroyPermissionRequest $request) 70 | { 71 | Permission::whereIn('id', request('ids'))->delete(); 72 | 73 | return response(null, Response::HTTP_NO_CONTENT); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/TagsController.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.tags.index'); 37 | } 38 | 39 | public function edit(Tag $tag) 40 | { 41 | abort_if(Gate::denies('tag_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 42 | 43 | return view('admin.tags.edit', compact('tag')); 44 | } 45 | 46 | public function update(UpdateTagRequest $request, Tag $tag) 47 | { 48 | $tag->update($request->all()); 49 | 50 | return redirect()->route('admin.tags.index'); 51 | } 52 | 53 | public function show(Tag $tag) 54 | { 55 | abort_if(Gate::denies('tag_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 56 | 57 | return view('admin.tags.show', compact('tag')); 58 | } 59 | 60 | public function destroy(Tag $tag) 61 | { 62 | abort_if(Gate::denies('tag_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 63 | 64 | $tag->delete(); 65 | 66 | return back(); 67 | } 68 | 69 | public function massDestroy(MassDestroyTagRequest $request) 70 | { 71 | Tag::whereIn('id', request('ids'))->delete(); 72 | 73 | return response(null, Response::HTTP_NO_CONTENT); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/ArticlesApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | } 22 | 23 | public function store(StoreArticleRequest $request) 24 | { 25 | $article = Article::create($request->all()); 26 | $article->tags()->sync($request->input('tags', [])); 27 | 28 | return (new ArticleResource($article)) 29 | ->response() 30 | ->setStatusCode(Response::HTTP_CREATED); 31 | } 32 | 33 | public function show(Article $article) 34 | { 35 | abort_if(Gate::denies('article_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 36 | 37 | return new ArticleResource($article->load(['category', 'tags'])); 38 | } 39 | 40 | public function update(UpdateArticleRequest $request, Article $article) 41 | { 42 | $article->update($request->all()); 43 | $article->tags()->sync($request->input('tags', [])); 44 | 45 | return (new ArticleResource($article)) 46 | ->response() 47 | ->setStatusCode(Response::HTTP_ACCEPTED); 48 | } 49 | 50 | public function destroy(Article $article) 51 | { 52 | abort_if(Gate::denies('article_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 53 | 54 | $article->delete(); 55 | 56 | return response(null, Response::HTTP_NO_CONTENT); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/CategoriesApiController.php: -------------------------------------------------------------------------------- 1 | all()); 26 | 27 | return (new CategoryResource($category)) 28 | ->response() 29 | ->setStatusCode(Response::HTTP_CREATED); 30 | } 31 | 32 | public function show(Category $category) 33 | { 34 | abort_if(Gate::denies('category_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 35 | 36 | return new CategoryResource($category); 37 | } 38 | 39 | public function update(UpdateCategoryRequest $request, Category $category) 40 | { 41 | $category->update($request->all()); 42 | 43 | return (new CategoryResource($category)) 44 | ->response() 45 | ->setStatusCode(Response::HTTP_ACCEPTED); 46 | } 47 | 48 | public function destroy(Category $category) 49 | { 50 | abort_if(Gate::denies('category_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 51 | 52 | $category->delete(); 53 | 54 | return response(null, Response::HTTP_NO_CONTENT); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/FaqCategoryApiController.php: -------------------------------------------------------------------------------- 1 | all()); 26 | 27 | return (new FaqCategoryResource($faqCategory)) 28 | ->response() 29 | ->setStatusCode(Response::HTTP_CREATED); 30 | } 31 | 32 | public function show(FaqCategory $faqCategory) 33 | { 34 | abort_if(Gate::denies('faq_category_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 35 | 36 | return new FaqCategoryResource($faqCategory); 37 | } 38 | 39 | public function update(UpdateFaqCategoryRequest $request, FaqCategory $faqCategory) 40 | { 41 | $faqCategory->update($request->all()); 42 | 43 | return (new FaqCategoryResource($faqCategory)) 44 | ->response() 45 | ->setStatusCode(Response::HTTP_ACCEPTED); 46 | } 47 | 48 | public function destroy(FaqCategory $faqCategory) 49 | { 50 | abort_if(Gate::denies('faq_category_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 51 | 52 | $faqCategory->delete(); 53 | 54 | return response(null, Response::HTTP_NO_CONTENT); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/FaqQuestionApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | } 22 | 23 | public function store(StoreFaqQuestionRequest $request) 24 | { 25 | $faqQuestion = FaqQuestion::create($request->all()); 26 | 27 | return (new FaqQuestionResource($faqQuestion)) 28 | ->response() 29 | ->setStatusCode(Response::HTTP_CREATED); 30 | } 31 | 32 | public function show(FaqQuestion $faqQuestion) 33 | { 34 | abort_if(Gate::denies('faq_question_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 35 | 36 | return new FaqQuestionResource($faqQuestion->load(['category'])); 37 | } 38 | 39 | public function update(UpdateFaqQuestionRequest $request, FaqQuestion $faqQuestion) 40 | { 41 | $faqQuestion->update($request->all()); 42 | 43 | return (new FaqQuestionResource($faqQuestion)) 44 | ->response() 45 | ->setStatusCode(Response::HTTP_ACCEPTED); 46 | } 47 | 48 | public function destroy(FaqQuestion $faqQuestion) 49 | { 50 | abort_if(Gate::denies('faq_question_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 51 | 52 | $faqQuestion->delete(); 53 | 54 | return response(null, Response::HTTP_NO_CONTENT); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/PermissionsApiController.php: -------------------------------------------------------------------------------- 1 | all()); 26 | 27 | return (new PermissionResource($permission)) 28 | ->response() 29 | ->setStatusCode(Response::HTTP_CREATED); 30 | } 31 | 32 | public function show(Permission $permission) 33 | { 34 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 35 | 36 | return new PermissionResource($permission); 37 | } 38 | 39 | public function update(UpdatePermissionRequest $request, Permission $permission) 40 | { 41 | $permission->update($request->all()); 42 | 43 | return (new PermissionResource($permission)) 44 | ->response() 45 | ->setStatusCode(Response::HTTP_ACCEPTED); 46 | } 47 | 48 | public function destroy(Permission $permission) 49 | { 50 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 51 | 52 | $permission->delete(); 53 | 54 | return response(null, Response::HTTP_NO_CONTENT); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/RolesApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | } 22 | 23 | public function store(StoreRoleRequest $request) 24 | { 25 | $role = Role::create($request->all()); 26 | $role->permissions()->sync($request->input('permissions', [])); 27 | 28 | return (new RoleResource($role)) 29 | ->response() 30 | ->setStatusCode(Response::HTTP_CREATED); 31 | } 32 | 33 | public function show(Role $role) 34 | { 35 | abort_if(Gate::denies('role_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 36 | 37 | return new RoleResource($role->load(['permissions'])); 38 | } 39 | 40 | public function update(UpdateRoleRequest $request, Role $role) 41 | { 42 | $role->update($request->all()); 43 | $role->permissions()->sync($request->input('permissions', [])); 44 | 45 | return (new RoleResource($role)) 46 | ->response() 47 | ->setStatusCode(Response::HTTP_ACCEPTED); 48 | } 49 | 50 | public function destroy(Role $role) 51 | { 52 | abort_if(Gate::denies('role_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 53 | 54 | $role->delete(); 55 | 56 | return response(null, Response::HTTP_NO_CONTENT); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/TagsApiController.php: -------------------------------------------------------------------------------- 1 | all()); 26 | 27 | return (new TagResource($tag)) 28 | ->response() 29 | ->setStatusCode(Response::HTTP_CREATED); 30 | } 31 | 32 | public function show(Tag $tag) 33 | { 34 | abort_if(Gate::denies('tag_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 35 | 36 | return new TagResource($tag); 37 | } 38 | 39 | public function update(UpdateTagRequest $request, Tag $tag) 40 | { 41 | $tag->update($request->all()); 42 | 43 | return (new TagResource($tag)) 44 | ->response() 45 | ->setStatusCode(Response::HTTP_ACCEPTED); 46 | } 47 | 48 | public function destroy(Tag $tag) 49 | { 50 | abort_if(Gate::denies('tag_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 51 | 52 | $tag->delete(); 53 | 54 | return response(null, Response::HTTP_NO_CONTENT); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/UsersApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | } 22 | 23 | public function store(StoreUserRequest $request) 24 | { 25 | $user = User::create($request->all()); 26 | $user->roles()->sync($request->input('roles', [])); 27 | 28 | return (new UserResource($user)) 29 | ->response() 30 | ->setStatusCode(Response::HTTP_CREATED); 31 | } 32 | 33 | public function show(User $user) 34 | { 35 | abort_if(Gate::denies('user_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 36 | 37 | return new UserResource($user->load(['roles'])); 38 | } 39 | 40 | public function update(UpdateUserRequest $request, User $user) 41 | { 42 | $user->update($request->all()); 43 | $user->roles()->sync($request->input('roles', [])); 44 | 45 | return (new UserResource($user)) 46 | ->response() 47 | ->setStatusCode(Response::HTTP_ACCEPTED); 48 | } 49 | 50 | public function destroy(User $user) 51 | { 52 | abort_if(Gate::denies('user_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 53 | 54 | $user->delete(); 55 | 56 | return response(null, Response::HTTP_NO_CONTENT); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Controllers/ArticleController.php: -------------------------------------------------------------------------------- 1 | orderBy('id', 'desc') 15 | ->paginate(5); 16 | 17 | return view('articles.index', compact('articles')); 18 | } 19 | 20 | public function show($slug, $article) 21 | { 22 | $article = Article::with(['tags', 'category']) 23 | ->withCount('tags') 24 | ->whereId($article) 25 | ->first(); 26 | 27 | $article->timestamps = false; 28 | $article->views_count++; 29 | $article->save(); 30 | 31 | return view('articles.show', compact('article')); 32 | } 33 | 34 | public function check_slug(Request $request) 35 | { 36 | $slug = SlugService::createSlug(Article::class, 'slug', $request->input('title','')); 37 | 38 | return response()->json(['slug' => $slug]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 41 | } 42 | 43 | /** 44 | * Get a validator for an incoming registration request. 45 | * 46 | * @param array $data 47 | * @return \Illuminate\Contracts\Validation\Validator 48 | */ 49 | protected function validator(array $data) 50 | { 51 | return Validator::make($data, [ 52 | 'name' => ['required', 'string', 'max:255'], 53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 54 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 55 | ]); 56 | } 57 | 58 | /** 59 | * Create a new user instance after a valid registration. 60 | * 61 | * @param array $data 62 | * @return \App\User 63 | */ 64 | protected function create(array $data) 65 | { 66 | return User::create([ 67 | 'name' => $data['name'], 68 | 'email' => $data['email'], 69 | 'password' => Hash::make($data['password']), 70 | ]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | $this->middleware('signed')->only('verify'); 39 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/CategoryController.php: -------------------------------------------------------------------------------- 1 | loadCount('articles'); 14 | 15 | $articles = $category->articles() 16 | ->paginate(5); 17 | 18 | return view('categories.show', compact(['category', 'articles'])); 19 | } 20 | 21 | public function check_slug(Request $request) 22 | { 23 | $slug = SlugService::createSlug(Category::class, 'slug', $request->input('name','')); 24 | 25 | return response()->json(['slug' => $slug]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | paginate(10); 13 | 14 | return view('faq', compact('categories')); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | with(['articles' => function($query) { 13 | $query->orderBy('id', 'desc'); 14 | }]) 15 | ->paginate(10); 16 | 17 | return view('index', compact('categories')); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Controllers/TagController.php: -------------------------------------------------------------------------------- 1 | loadCount('articles'); 14 | 15 | $articles = $tag->articles() 16 | ->with('category') 17 | ->orderBy('id', 'desc') 18 | ->paginate(5); 19 | 20 | return view('tags.show', compact(['articles', 'tag'])); 21 | } 22 | 23 | public function check_slug(Request $request) 24 | { 25 | $slug = SlugService::createSlug(Tag::class, 'slug', $request->input('name','')); 26 | 27 | return response()->json(['slug' => $slug]); 28 | } 29 | } -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'throttle:60,1', 20 | 'bindings', 21 | \App\Http\Middleware\AuthGates::class, 22 | ], 23 | 'web' => [ 24 | \App\Http\Middleware\EncryptCookies::class, 25 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 26 | \Illuminate\Session\Middleware\StartSession::class, 27 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 28 | \App\Http\Middleware\VerifyCsrfToken::class, 29 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 30 | \App\Http\Middleware\AuthGates::class, 31 | \App\Http\Middleware\SetLocale::class, 32 | ], 33 | ]; 34 | 35 | protected $routeMiddleware = [ 36 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 37 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 38 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 39 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 40 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 41 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 42 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 43 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Middleware/AuthGates.php: -------------------------------------------------------------------------------- 1 | runningInConsole() && $user) { 16 | $roles = Role::with('permissions')->get(); 17 | $permissionsArray = []; 18 | 19 | foreach ($roles as $role) { 20 | foreach ($role->permissions as $permissions) { 21 | $permissionsArray[$permissions->title][] = $role->id; 22 | } 23 | } 24 | 25 | foreach ($permissionsArray as $title => $roles) { 26 | Gate::define($title, function (\App\User $user) use ($roles) { 27 | return count(array_intersect($user->roles->pluck('id')->toArray(), $roles)) > 0; 28 | }); 29 | } 30 | } 31 | 32 | return $next($request); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/SetLocale.php: -------------------------------------------------------------------------------- 1 | put('language', request('change_language')); 13 | $language = request('change_language'); 14 | } elseif (session('language')) { 15 | $language = session('language'); 16 | } elseif (config('panel.primary_language')) { 17 | $language = config('panel.primary_language'); 18 | } 19 | 20 | if (isset($language)) { 21 | app()->setLocale($language); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:articles,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyCategoryRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:categories,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyFaqCategoryRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:faq_categories,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyFaqQuestionRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:faq_questions,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyPermissionRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:permissions,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyRoleRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:roles,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyTagRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:tags,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyUserRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 23 | 'ids.*' => 'exists:users,id', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreArticleRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:articles' 27 | ], 28 | 'tags.*' => [ 29 | 'integer', 30 | ], 31 | 'tags' => [ 32 | 'array', 33 | ], 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:categories' 27 | ], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreFaqCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreFaqQuestionRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | 'integer', 25 | ], 26 | 'question' => [ 27 | 'required', 28 | ], 29 | 'answer' => [ 30 | 'required', 31 | ], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/StorePermissionRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreRoleRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'permissions.*' => [ 26 | 'integer', 27 | ], 28 | 'permissions' => [ 29 | 'required', 30 | 'array', 31 | ], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreTagRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:tags' 27 | ], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreUserRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'email' => [ 26 | 'required', 27 | 'unique:users', 28 | ], 29 | 'password' => [ 30 | 'required', 31 | ], 32 | 'roles.*' => [ 33 | 'integer', 34 | ], 35 | 'roles' => [ 36 | 'required', 37 | 'array', 38 | ], 39 | ]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateArticleRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:articles,slug,'.$this->route('article')->id 27 | ], 28 | 'tags.*' => [ 29 | 'integer', 30 | ], 31 | 'tags' => [ 32 | 'array', 33 | ], 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:categories,slug,'.$this->route('category')->id 27 | ], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateFaqCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateFaqQuestionRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | 'integer', 25 | ], 26 | 'question' => [ 27 | 'required', 28 | ], 29 | 'answer' => [ 30 | 'required', 31 | ], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdatePermissionRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateRoleRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'permissions.*' => [ 26 | 'integer', 27 | ], 28 | 'permissions' => [ 29 | 'required', 30 | 'array', 31 | ], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateTagRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'slug' => [ 26 | 'required', 'unique:tags,slug,'.$this->route('tag')->id 27 | ], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateUserRequest.php: -------------------------------------------------------------------------------- 1 | [ 23 | 'required', 24 | ], 25 | 'email' => [ 26 | 'required', 27 | 'unique:users,email,' . request()->route('user')->id, 28 | ], 29 | 'roles.*' => [ 30 | 'integer', 31 | ], 32 | 'roles' => [ 33 | 'required', 34 | 'array', 35 | ], 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Resources/Admin/ArticleResource.php: -------------------------------------------------------------------------------- 1 | with('popularArticles', Article::orderBy('views_count', 'desc')->take(6)->get()); 21 | $view->with('latestArticles', Article::orderBy('id', 'desc')->take(6)->get()); 22 | $view->with('popularTags', Tag::withCount('articles')->orderBy('articles_count', 'desc')->take(20)->get()); 23 | $view->with('footerCategories', Category::take(6)->get()); 24 | } 25 | } -------------------------------------------------------------------------------- /app/Permission.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Role::class); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | if (!app()->runningInConsole()) { 30 | Passport::routes(); 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 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 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Role.php: -------------------------------------------------------------------------------- 1 | belongsToMany(User::class); 30 | } 31 | 32 | public function permissions() 33 | { 34 | return $this->belongsToMany(Permission::class); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Tag.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Article::class); 32 | } 33 | 34 | public function sluggable() 35 | { 36 | return [ 37 | 'slug' => [ 38 | 'source' => 'name' 39 | ] 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; 46 | } 47 | 48 | public function setEmailVerifiedAtAttribute($value) 49 | { 50 | $this->attributes['email_verified_at'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null; 51 | } 52 | 53 | public function setPasswordAttribute($input) 54 | { 55 | if ($input) { 56 | $this->attributes['password'] = app('hash')->needsRehash($input) ? Hash::make($input) : $input; 57 | } 58 | } 59 | 60 | public function sendPasswordResetNotification($token) 61 | { 62 | $this->notify(new ResetPassword($token)); 63 | } 64 | 65 | public function roles() 66 | { 67 | return $this->belongsToMany(Role::class); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.3", 12 | "cviebrock/eloquent-sluggable": "^8.0", 13 | "doctrine/dbal": "^2.11", 14 | "fideloper/proxy": "^4.2", 15 | "guzzlehttp/guzzle": "^7.0.1", 16 | "laravel/framework": "^8.0", 17 | "laravel/passport": "^10.0", 18 | "laravel/tinker": "^2.0", 19 | "laravel/ui": "^3.0", 20 | "yajra/laravel-datatables-oracle": "^9.6" 21 | }, 22 | "require-dev": { 23 | "facade/ignition": "^2.3.6", 24 | "fzaninotto/faker": "^1.9.1", 25 | "mockery/mockery": "^1.3.1", 26 | "nunomaduro/collision": "^5.0", 27 | "phpunit/phpunit": "^9.3" 28 | }, 29 | "config": { 30 | "optimize-autoloader": true, 31 | "preferred-install": "dist", 32 | "sort-packages": true 33 | }, 34 | "extra": { 35 | "laravel": { 36 | "dont-discover": [] 37 | } 38 | }, 39 | "autoload": { 40 | "psr-4": { 41 | "App\\": "app/" 42 | }, 43 | "classmap": [ 44 | "database/seeds", 45 | "database/factories" 46 | ] 47 | }, 48 | "autoload-dev": { 49 | "psr-4": { 50 | "Tests\\": "tests/" 51 | } 52 | }, 53 | "minimum-stability": "dev", 54 | "prefer-stable": true, 55 | "scripts": { 56 | "post-autoload-dump": [ 57 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 58 | "@php artisan package:discover --ansi" 59 | ], 60 | "post-root-package-install": [ 61 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 62 | ], 63 | "post-create-project-cmd": [ 64 | "@php artisan key:generate --ansi" 65 | ] 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /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 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /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' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/panel.php: -------------------------------------------------------------------------------- 1 | 'Y-m-d', 5 | 'time_format' => 'H:i:s', 6 | 'primary_language' => 'en', 7 | 'available_languages' => [ 8 | 'en' => 'English', 9 | ], 10 | ]; 11 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 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/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /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/2019_10_11_000001_create_permissions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('title')->nullable(); 15 | 16 | $table->timestamps(); 17 | 18 | $table->softDeletes(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000002_create_roles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('title')->nullable(); 15 | 16 | $table->timestamps(); 17 | 18 | $table->softDeletes(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000003_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('name'); 15 | 16 | $table->string('email')->unique(); 17 | 18 | $table->datetime('email_verified_at')->nullable(); 19 | 20 | $table->string('password'); 21 | 22 | $table->string('remember_token')->nullable(); 23 | 24 | $table->timestamps(); 25 | 26 | $table->softDeletes(); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000004_create_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('name'); 15 | 16 | $table->timestamps(); 17 | 18 | $table->softDeletes(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000005_create_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('name'); 15 | 16 | $table->timestamps(); 17 | 18 | $table->softDeletes(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000006_create_articles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('title'); 15 | 16 | $table->longText('short_text')->nullable(); 17 | 18 | $table->longText('full_text')->nullable(); 19 | 20 | $table->unsignedInteger('category_id')->nullable(); 21 | 22 | $table->foreign('category_id')->references('id')->on('categories'); 23 | 24 | $table->timestamps(); 25 | 26 | $table->softDeletes(); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000007_create_faq_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->string('category')->nullable(); 15 | 16 | $table->timestamps(); 17 | 18 | $table->softDeletes(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000008_create_faq_questions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | 14 | $table->longText('question')->nullable(); 15 | 16 | $table->longText('answer')->nullable(); 17 | 18 | $table->timestamps(); 19 | 20 | $table->softDeletes(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000009_create_permission_role_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('role_id'); 13 | 14 | $table->foreign('role_id', 'role_id_fk_455854')->references('id')->on('roles')->onDelete('cascade'); 15 | 16 | $table->unsignedInteger('permission_id'); 17 | 18 | $table->foreign('permission_id', 'permission_id_fk_455854')->references('id')->on('permissions')->onDelete('cascade'); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000010_create_role_user_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('user_id'); 13 | 14 | $table->foreign('user_id', 'user_id_fk_455863')->references('id')->on('users')->onDelete('cascade'); 15 | 16 | $table->unsignedInteger('role_id'); 17 | 18 | $table->foreign('role_id', 'role_id_fk_455863')->references('id')->on('roles')->onDelete('cascade'); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000012_create_article_tag_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('article_id'); 13 | 14 | $table->foreign('article_id', 'article_id_fk_455948')->references('id')->on('articles')->onDelete('cascade'); 15 | 16 | $table->unsignedInteger('tag_id'); 17 | 18 | $table->foreign('tag_id', 'tag_id_fk_455948')->references('id')->on('tags')->onDelete('cascade'); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2019_10_11_000013_add_relationship_fields_to_faq_questions_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('category_id')->nullable(); 13 | 14 | $table->foreign('category_id', 'category_fk_455958')->references('id')->on('faq_categories'); 15 | }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /database/migrations/2019_10_13_092522_add_views_count_to_articles_table.php: -------------------------------------------------------------------------------- 1 | integer('views_count')->unsigned()->default(0); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('articles', function (Blueprint $table) { 29 | $table->dropColumn('views_count'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_10_14_141550_add_slug_to_multiple_tables.php: -------------------------------------------------------------------------------- 1 | string('slug')->unique(); 18 | }); 19 | Schema::table('categories', function (Blueprint $table) { 20 | $table->string('slug')->unique(); 21 | }); 22 | Schema::table('tags', function (Blueprint $table) { 23 | $table->string('slug')->unique(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('articles', function (Blueprint $table) { 35 | $table->dropUnique('articles_slug_unique'); 36 | $table->dropColumn('slug'); 37 | }); 38 | Schema::table('categories', function (Blueprint $table) { 39 | $table->dropUnique('categories_slug_unique'); 40 | $table->dropColumn('slug'); 41 | }); 42 | Schema::table('tags', function (Blueprint $table) { 43 | $table->dropUnique('tags_slug_unique'); 44 | $table->dropColumn('slug'); 45 | }); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/seeds/ArticlesTableSeeder.php: -------------------------------------------------------------------------------- 1 | title = $faker->sentence; 27 | $article->slug = SlugService::createSlug(Article::class, 'slug', $article->title); 28 | $article->short_text = $faker->paragraph; 29 | $article->full_text = $faker->paragraph(9); 30 | $article->views_count = rand(0, 1000); 31 | $article->category_id = $categories->random(); 32 | $article->save(); 33 | 34 | $article->tags()->sync($tags->random(rand(1, $tags->count()))); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/seeds/CategoriesTableSeeder.php: -------------------------------------------------------------------------------- 1 | $categories) 19 | Category::create(['name' => $categories, 'slug' => SlugService::createSlug(Category::class, 'slug', $categories)]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call([ 10 | PermissionsTableSeeder::class, 11 | RolesTableSeeder::class, 12 | PermissionRoleTableSeeder::class, 13 | UsersTableSeeder::class, 14 | RoleUserTableSeeder::class, 15 | 16 | CategoriesTableSeeder::class, 17 | TagsTableSeeder::class, 18 | ArticlesTableSeeder::class, 19 | FaqsTableSeeder::class, 20 | ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/seeds/FaqsTableSeeder.php: -------------------------------------------------------------------------------- 1 | $category]); 23 | foreach(range(1,5) as $id) 24 | { 25 | $question = new FaqQuestion; 26 | $question->question = $faker->sentence; 27 | $question->answer = $faker->paragraph; 28 | $category->faqQuestions()->save($question); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/PermissionRoleTableSeeder.php: -------------------------------------------------------------------------------- 1 | permissions()->sync($admin_permissions->pluck('id')); 13 | $user_permissions = $admin_permissions->filter(function ($permission) { 14 | return substr($permission->title, 0, 5) != 'user_' && substr($permission->title, 0, 5) != 'role_' && substr($permission->title, 0, 11) != 'permission_'; 15 | }); 16 | Role::findOrFail(2)->permissions()->sync($user_permissions); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /database/seeds/RoleUserTableSeeder.php: -------------------------------------------------------------------------------- 1 | roles()->sync(1); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /database/seeds/RolesTableSeeder.php: -------------------------------------------------------------------------------- 1 | 1, 13 | 'title' => 'Admin', 14 | ], 15 | [ 16 | 'id' => 2, 17 | 'title' => 'User', 18 | ], 19 | ]; 20 | 21 | Role::insert($roles); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /database/seeds/TagsTableSeeder.php: -------------------------------------------------------------------------------- 1 | word; 21 | Tag::create(['name' => $word, 'slug' => SlugService::createSlug(Tag::class, 'slug', $word)]); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | 1, 13 | 'name' => 'Admin', 14 | 'email' => 'admin@admin.com', 15 | 'password' => '$2y$10$7EMc/1kS3h/LOzH9IkXakOzHi9EG1PCDhmO3ckYlZcIh8R2jnQ0WK', 16 | 'remember_token' => null, 17 | ], 18 | ]; 19 | 20 | User::insert($users); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.19", 14 | "cross-env": "^5.1", 15 | "laravel-mix": "^4.0.7", 16 | "lodash": "^4.17.13", 17 | "resolve-url-loader": "^2.3.1", 18 | "sass": "^1.15.2", 19 | "sass-loader": "^7.1.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /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 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/css/custom.css: -------------------------------------------------------------------------------- 1 | .ck-editor__editable, 2 | textarea { 3 | min-height: 150px; 4 | } 5 | 6 | .datatable { 7 | width: 100% !important; 8 | } 9 | 10 | .dataTables_length, 11 | .dataTables_filter, 12 | .dt-buttons { 13 | margin-bottom: 0.333em; 14 | margin-top: .2rem; 15 | } 16 | 17 | .dataTables_filter { 18 | margin-right: .2rem; 19 | } 20 | 21 | .dt-buttons .btn { 22 | margin-left: 0.333em; 23 | border-radius: 0; 24 | } 25 | 26 | .table.datatable { 27 | box-sizing: border-box; 28 | border-collapse: collapse; 29 | } 30 | 31 | table.dataTable thead th { 32 | border-bottom: 2px solid #c8ced3; 33 | } 34 | 35 | .dataTables_wrapper.no-footer .dataTables_scrollBody { 36 | border-bottom: 1px solid #c8ced3; 37 | } 38 | 39 | .select2 { 40 | max-width: 100%; 41 | width: 100% !important; 42 | } 43 | 44 | .select2-selection__rendered { 45 | padding-bottom: 5px !important; 46 | } 47 | 48 | .has-error .invalid-feedback { 49 | display: block !important; 50 | } 51 | 52 | .btn-info, 53 | .badge-info { 54 | color: white; 55 | } 56 | 57 | table.dataTable thead .sorting, 58 | table.dataTable thead .sorting_asc, 59 | table.dataTable thead .sorting_desc { 60 | background-image: none; 61 | } 62 | 63 | .sidebar .nav-item { 64 | cursor: pointer; 65 | } 66 | 67 | .btn-default { 68 | color: #23282c; 69 | background-color: #f0f3f5; 70 | border-color: #f0f3f5; 71 | } 72 | 73 | .btn-default.focus, 74 | .btn-default:focus { 75 | box-shadow: 0 0 0 .2rem rgba(209, 213, 215, .5); 76 | } 77 | 78 | .btn-default:hover { 79 | color: #23282c; 80 | background-color: #d9e1e6; 81 | border-color: #d1dbe1; 82 | } 83 | 84 | .btn-group-xs > .btn, 85 | .btn-xs { 86 | padding: 1px 5px; 87 | font-size: 12px; 88 | line-height: 1.5; 89 | border-radius: 3px; 90 | } 91 | 92 | .searchable-title { 93 | font-weight: bold; 94 | } 95 | .searchable-fields { 96 | padding-left:5px; 97 | } 98 | .searchable-link { 99 | padding:0 5px 0 5px; 100 | } 101 | .searchable-link:hover { 102 | cursor: pointer; 103 | background: #eaeaea; 104 | } 105 | .select2-results__option { 106 | padding-left: 0px; 107 | padding-right: 0px; 108 | } 109 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/fonts/droid-serif/DroidSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/droid-serif/DroidSerif-Bold.ttf -------------------------------------------------------------------------------- /public/fonts/droid-serif/DroidSerif-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/droid-serif/DroidSerif-BoldItalic.ttf -------------------------------------------------------------------------------- /public/fonts/droid-serif/DroidSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/droid-serif/DroidSerif-Italic.ttf -------------------------------------------------------------------------------- /public/fonts/droid-serif/DroidSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/droid-serif/DroidSerif-Regular.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/fonts/ufonts.com_copperplate-gothic-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/fonts/ufonts.com_copperplate-gothic-regular.ttf -------------------------------------------------------------------------------- /public/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/404.png -------------------------------------------------------------------------------- /public/images/article-images/bnw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/article-images/bnw.jpg -------------------------------------------------------------------------------- /public/images/article-images/ipad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/article-images/ipad.jpg -------------------------------------------------------------------------------- /public/images/article-images/write.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/article-images/write.jpg -------------------------------------------------------------------------------- /public/images/blogimgbig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/blogimgbig.jpg -------------------------------------------------------------------------------- /public/images/blogimgthumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/blogimgthumb.jpg -------------------------------------------------------------------------------- /public/images/helpdesk-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/helpdesk-icon.png -------------------------------------------------------------------------------- /public/images/listarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/listarrow.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/logo.png -------------------------------------------------------------------------------- /public/images/page-headers/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/1.jpg -------------------------------------------------------------------------------- /public/images/page-headers/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/10.jpg -------------------------------------------------------------------------------- /public/images/page-headers/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/2.jpg -------------------------------------------------------------------------------- /public/images/page-headers/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/3.jpg -------------------------------------------------------------------------------- /public/images/page-headers/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/4.jpg -------------------------------------------------------------------------------- /public/images/page-headers/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/5.jpg -------------------------------------------------------------------------------- /public/images/page-headers/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/6.jpg -------------------------------------------------------------------------------- /public/images/page-headers/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/7.jpg -------------------------------------------------------------------------------- /public/images/page-headers/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/8.jpg -------------------------------------------------------------------------------- /public/images/page-headers/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/page-headers/9.jpg -------------------------------------------------------------------------------- /public/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/search.png -------------------------------------------------------------------------------- /public/images/searchicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/searchicon.gif -------------------------------------------------------------------------------- /public/images/template_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/template_pic.jpg -------------------------------------------------------------------------------- /public/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/user.png -------------------------------------------------------------------------------- /public/images/videoicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-KnowledgeBase-FAQ/88f2fd066ac1efe95df206ff7b7c01de7e115a37/public/images/videoicon.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /public/js/app.js: -------------------------------------------------------------------------------- 1 | function myFunction() { 2 | document.getElementsByClassName("topnav")[0].classList.toggle("responsive"); 3 | } 4 | 5 | /* COMMENTS LAST BORDER REMOVAL */ 6 | $(function() { 7 | var comments = $('div.article-comment-top'); 8 | var last = comments.last(); 9 | last.css({ borderBottom : 'none' }); 10 | }); 11 | -------------------------------------------------------------------------------- /public/js/main.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | window._token = $('meta[name="csrf-token"]').attr('content') 3 | 4 | var allEditors = document.querySelectorAll('.ckeditor'); 5 | for (var i = 0; i < allEditors.length; ++i) { 6 | ClassicEditor.create( 7 | allEditors[i], 8 | { 9 | removePlugins: ['ImageUpload'] 10 | } 11 | ); 12 | } 13 | 14 | moment.updateLocale('en', { 15 | week: {dow: 1} // Monday is the first day of the week 16 | }) 17 | 18 | $('.date').datetimepicker({ 19 | format: 'YYYY-MM-DD', 20 | locale: 'en' 21 | }) 22 | 23 | $('.datetime').datetimepicker({ 24 | format: 'YYYY-MM-DD HH:mm:ss', 25 | locale: 'en', 26 | sideBySide: true 27 | }) 28 | 29 | $('.timepicker').datetimepicker({ 30 | format: 'HH:mm:ss' 31 | }) 32 | 33 | $('.select-all').click(function () { 34 | let $select2 = $(this).parent().siblings('.select2') 35 | $select2.find('option').prop('selected', 'selected') 36 | $select2.trigger('change') 37 | }) 38 | $('.deselect-all').click(function () { 39 | let $select2 = $(this).parent().siblings('.select2') 40 | $select2.find('option').prop('selected', '') 41 | $select2.trigger('change') 42 | }) 43 | 44 | $('.select2').select2() 45 | 46 | $('.treeview').each(function () { 47 | var shouldExpand = false 48 | $(this).find('li').each(function () { 49 | if ($(this).hasClass('active')) { 50 | shouldExpand = true 51 | } 52 | }) 53 | if (shouldExpand) { 54 | $(this).addClass('active') 55 | } 56 | }) 57 | }) 58 | -------------------------------------------------------------------------------- /public/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // encrypted: true 28 | // }); 29 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 5 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 6 | ]; 7 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 5 | 'next' => 'Next »', 6 | ]; 7 | -------------------------------------------------------------------------------- /resources/lang/en/panel.php: -------------------------------------------------------------------------------- 1 | 'Knowledge Base', 5 | ]; 6 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 5 | 'reset' => 'Your password has been reset!', 6 | 'sent' => 'We have e-mailed your password reset link!', 7 | 'token' => 'This password reset token is invalid.', 8 | 'user' => 'We can\'t find a user with that e-mail address.', 9 | 'updated' => 'Your password has been changed!', 10 | ]; 11 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /resources/views/admin/categories/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.category.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('name')) 16 | 17 | {{ $errors->first('name') }} 18 | 19 | @endif 20 |

21 | {{ trans('cruds.category.fields.name_helper') }} 22 |

23 |
24 |
25 | 26 | 27 | @if($errors->has('slug')) 28 | 29 | {{ $errors->first('slug') }} 30 | 31 | @endif 32 |

33 | {{ trans('cruds.category.fields.slug_helper') }} 34 |

35 |
36 |
37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | @endsection 45 | 46 | @section('scripts') 47 | 57 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/categories/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.category.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" method="POST" enctype="multipart/form-data"> 11 | @csrf 12 | @method('PUT') 13 |
14 | 15 | 16 | @if($errors->has('name')) 17 | 18 | {{ $errors->first('name') }} 19 | 20 | @endif 21 |

22 | {{ trans('cruds.category.fields.name_helper') }} 23 |

24 |
25 |
26 | 27 | 28 | @if($errors->has('slug')) 29 | 30 | {{ $errors->first('slug') }} 31 | 32 | @endif 33 |

34 | {{ trans('cruds.category.fields.slug_helper') }} 35 |

36 |
37 |
38 | 39 |
40 |
41 | 42 | 43 |
44 |
45 | @endsection 46 | 47 | @section('scripts') 48 | 58 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/categories/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.category.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 33 | 36 | 37 | 38 |
15 | {{ trans('cruds.category.fields.id') }} 16 | 18 | {{ $category->id }} 19 |
23 | {{ trans('cruds.category.fields.name') }} 24 | 26 | {{ $category->name }} 27 |
31 | {{ trans('cruds.category.fields.slug') }} 32 | 34 | {{ $category->slug }} 35 |
39 | 40 | {{ trans('global.back_to_list') }} 41 | 42 |
43 | 44 | 49 |
50 | 51 |
52 |
53 |
54 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/faqCategories/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.faqCategory.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('category')) 16 | 17 | {{ $errors->first('category') }} 18 | 19 | @endif 20 |

21 | {{ trans('cruds.faqCategory.fields.category_helper') }} 22 |

23 |
24 |
25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/faqCategories/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.faqCategory.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" method="POST" enctype="multipart/form-data"> 11 | @csrf 12 | @method('PUT') 13 |
14 | 15 | 16 | @if($errors->has('category')) 17 | 18 | {{ $errors->first('category') }} 19 | 20 | @endif 21 |

22 | {{ trans('cruds.faqCategory.fields.category_helper') }} 23 |

24 |
25 |
26 | 27 |
28 |
29 | 30 | 31 |
32 |
33 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/faqCategories/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.faqCategory.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 |
15 | {{ trans('cruds.faqCategory.fields.id') }} 16 | 18 | {{ $faqCategory->id }} 19 |
23 | {{ trans('cruds.faqCategory.fields.category') }} 24 | 26 | {{ $faqCategory->category }} 27 |
31 | 32 | {{ trans('global.back_to_list') }} 33 | 34 |
35 | 36 | 41 |
42 | 43 |
44 |
45 |
46 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/faqQuestions/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.faqQuestion.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 33 | 36 | 37 | 38 | 41 | 44 | 45 | 46 |
15 | {{ trans('cruds.faqQuestion.fields.id') }} 16 | 18 | {{ $faqQuestion->id }} 19 |
23 | {{ trans('cruds.faqQuestion.fields.category') }} 24 | 26 | {{ $faqQuestion->category->category ?? '' }} 27 |
31 | {{ trans('cruds.faqQuestion.fields.question') }} 32 | 34 | {!! $faqQuestion->question !!} 35 |
39 | {{ trans('cruds.faqQuestion.fields.answer') }} 40 | 42 | {!! $faqQuestion->answer !!} 43 |
47 | 48 | {{ trans('global.back_to_list') }} 49 | 50 |
51 | 52 | 53 |
54 |
55 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 |
4 |
5 |
6 | Home 7 |
8 |
9 |
10 | @endsection 11 | @section('scripts') 12 | @parent 13 | 14 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.permission.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('title')) 16 | 17 | {{ $errors->first('title') }} 18 | 19 | @endif 20 |

21 | {{ trans('cruds.permission.fields.title_helper') }} 22 |

23 |
24 |
25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.permission.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" method="POST" enctype="multipart/form-data"> 11 | @csrf 12 | @method('PUT') 13 |
14 | 15 | 16 | @if($errors->has('title')) 17 | 18 | {{ $errors->first('title') }} 19 | 20 | @endif 21 |

22 | {{ trans('cruds.permission.fields.title_helper') }} 23 |

24 |
25 |
26 | 27 |
28 |
29 | 30 | 31 |
32 |
33 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.permission.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 |
15 | {{ trans('cruds.permission.fields.id') }} 16 | 18 | {{ $permission->id }} 19 |
23 | {{ trans('cruds.permission.fields.title') }} 24 | 26 | {{ $permission->title }} 27 |
31 | 32 | {{ trans('global.back_to_list') }} 33 | 34 |
35 | 36 | 41 |
42 | 43 |
44 |
45 |
46 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/roles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.role.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('title')) 16 | 17 | {{ $errors->first('title') }} 18 | 19 | @endif 20 |

21 | {{ trans('cruds.role.fields.title_helper') }} 22 |

23 |
24 |
25 | 28 | 33 | @if($errors->has('permissions')) 34 | 35 | {{ $errors->first('permissions') }} 36 | 37 | @endif 38 |

39 | {{ trans('cruds.role.fields.permissions_helper') }} 40 |

41 |
42 |
43 | 44 |
45 |
46 | 47 | 48 |
49 |
50 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/roles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.role.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 33 | 38 | 39 | 40 |
15 | {{ trans('cruds.role.fields.id') }} 16 | 18 | {{ $role->id }} 19 |
23 | {{ trans('cruds.role.fields.title') }} 24 | 26 | {{ $role->title }} 27 |
31 | Permissions 32 | 34 | @foreach($role->permissions as $id => $permissions) 35 | {{ $permissions->title }} 36 | @endforeach 37 |
41 | 42 | {{ trans('global.back_to_list') }} 43 | 44 |
45 | 46 | 51 |
52 | 53 |
54 |
55 |
56 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/tags/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.tag.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('name')) 16 | 17 | {{ $errors->first('name') }} 18 | 19 | @endif 20 |

21 | {{ trans('cruds.tag.fields.name_helper') }} 22 |

23 |
24 |
25 | 26 | 27 | @if($errors->has('slug')) 28 | 29 | {{ $errors->first('slug') }} 30 | 31 | @endif 32 |

33 | {{ trans('cruds.tag.fields.slug_helper') }} 34 |

35 |
36 |
37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | @endsection 45 | 46 | @section('scripts') 47 | 57 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/tags/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.tag.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" method="POST" enctype="multipart/form-data"> 11 | @csrf 12 | @method('PUT') 13 |
14 | 15 | 16 | @if($errors->has('name')) 17 | 18 | {{ $errors->first('name') }} 19 | 20 | @endif 21 |

22 | {{ trans('cruds.tag.fields.name_helper') }} 23 |

24 |
25 |
26 | 27 | 28 | @if($errors->has('slug')) 29 | 30 | {{ $errors->first('slug') }} 31 | 32 | @endif 33 |

34 | {{ trans('cruds.tag.fields.slug_helper') }} 35 |

36 |
37 |
38 | 39 |
40 |
41 | 42 | 43 |
44 |
45 | @endsection 46 | 47 | @section('scripts') 48 | 58 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/tags/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.tag.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 33 | 36 | 37 | 38 |
15 | {{ trans('cruds.tag.fields.id') }} 16 | 18 | {{ $tag->id }} 19 |
23 | {{ trans('cruds.tag.fields.name') }} 24 | 26 | {{ $tag->name }} 27 |
31 | {{ trans('cruds.tag.fields.slug') }} 32 | 34 | {{ $tag->slug }} 35 |
39 | 40 | {{ trans('global.back_to_list') }} 41 | 42 |
43 | 44 | 49 |
50 | 51 |
52 |
53 |
54 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.user.title') }} 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 33 | 36 | 37 | 38 | 41 | 44 | 45 | 46 | 49 | 54 | 55 | 56 |
15 | {{ trans('cruds.user.fields.id') }} 16 | 18 | {{ $user->id }} 19 |
23 | {{ trans('cruds.user.fields.name') }} 24 | 26 | {{ $user->name }} 27 |
31 | {{ trans('cruds.user.fields.email') }} 32 | 34 | {{ $user->email }} 35 |
39 | {{ trans('cruds.user.fields.email_verified_at') }} 40 | 42 | {{ $user->email_verified_at }} 43 |
47 | Roles 48 | 50 | @foreach($user->roles as $id => $roles) 51 | {{ $roles->title }} 52 | @endforeach 53 |
57 | 58 | {{ trans('global.back_to_list') }} 59 | 60 |
61 | 62 | 63 |
64 |
65 | @endsection -------------------------------------------------------------------------------- /resources/views/articles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 17 | 18 | 19 |
20 | All Articles 21 |
22 |
23 | 24 | @foreach($articles as $article) 25 |
26 |
27 | 28 | {{ $article->title }} 29 |
30 | 42 |
43 |

44 | {{ $article->short_text }} 45 |

46 |
47 |
48 | Read more... 49 |
50 |
51 | @endforeach 52 | 53 | {{ $articles->links('partials.pagination') }} 54 |
55 |
56 | @endsection -------------------------------------------------------------------------------- /resources/views/articles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 23 | 24 | 25 |
26 |
27 | {{ $article->title }} 28 |
29 | 41 |
42 | {!! $article->full_text !!} 43 |
44 | @if($article->tags_count) 45 |
46 | 52 |
53 | @endif 54 |
55 |
56 |
57 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |
7 |
8 |
9 | {{ csrf_field() }} 10 |

11 | 16 |

17 |

18 |
19 | {{ csrf_field() }} 20 |
21 | 22 | @if($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 |
30 |
31 | 34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | @endsection -------------------------------------------------------------------------------- /resources/views/categories/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 | 16 |
17 | Knowledge Base 18 |
19 |
20 |
21 | @foreach($categories as $category) 22 |
23 | 29 |
30 | 39 |
40 |
41 | @endforeach 42 |
43 | 44 | {{ $categories->links('partials.pagination') }} 45 |
46 |
47 | @endsection -------------------------------------------------------------------------------- /resources/views/categories/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 | 19 | 20 |
21 | Category: {{ $category->name }} 22 | ({{ $category->articles_count }}) 23 |
24 |
25 | @foreach($category->articles as $article) 26 |
27 |
28 | 29 | {{ $article->title }} 30 |
31 | 43 |
44 |

45 | {{ $article->short_text }} 46 |

47 |
48 |
49 | Read more... 50 |
51 |
52 | @endforeach 53 | 54 | {{ $articles->links('partials.pagination') }} 55 |
56 |
57 | @endsection -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 | 404 6 |

Oops, looks like we could not find the page you requested

7 |
8 | 9 | Back to home page 10 |
11 | @endsection -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ trans('panel.site_title') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | @yield('styles') 22 | 23 | 24 | 25 |
26 |
27 | @yield("content") 28 |
29 |
30 | @yield('scripts') 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /resources/views/layouts/main.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ trans('panel.site_title') }} 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 | 20 |
21 |
22 |
23 | 24 | @include('partials.nav') 25 | 26 | @if(!isset($exception)) 27 |
28 |
29 |
30 |

{{ trans('panel.site_title') }}

31 | Learn to use gomac 32 |
33 |
34 |
35 | @endif 36 | 37 | 46 | 47 | @yield('about') 48 | 49 | @include('partials.footer') 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /resources/views/partials/nav.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 27 |
-------------------------------------------------------------------------------- /resources/views/partials/pagination.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 46 | @endif -------------------------------------------------------------------------------- /resources/views/tags/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 | 16 | 17 |
18 | Tag: {{ $tag->name }} 19 | ({{ $tag->articles_count }}) 20 |
21 |
22 | @foreach($articles as $article) 23 |
24 |
25 | 26 | {{ $article->title }} 27 |
28 | 40 |
41 |

42 | {{ $article->short_text }} 43 |

44 |
45 |
46 | Read more... 47 |
48 |
49 | @endforeach 50 | 51 | {{ $articles->links('partials.pagination') }} 52 |
53 |
54 | @endsection -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | 'v1', 'as' => 'api.', 'namespace' => 'Api\V1\Admin', 'middleware' => ['auth:api']], function () { 4 | // Permissions 5 | Route::apiResource('permissions', 'PermissionsApiController'); 6 | 7 | // Roles 8 | Route::apiResource('roles', 'RolesApiController'); 9 | 10 | // Users 11 | Route::apiResource('users', 'UsersApiController'); 12 | 13 | // Categories 14 | Route::apiResource('categories', 'CategoriesApiController'); 15 | 16 | // Tags 17 | Route::apiResource('tags', 'TagsApiController'); 18 | 19 | // Articles 20 | Route::apiResource('articles', 'ArticlesApiController'); 21 | 22 | // Faq Categories 23 | Route::apiResource('faq-categories', 'FaqCategoryApiController'); 24 | 25 | // Faq Questions 26 | Route::apiResource('faq-questions', 'FaqQuestionApiController'); 27 | }); 28 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | false]); 5 | 6 | Route::get('/', 'HomeController@index')->name('home'); 7 | Route::get('categories/check_slug', 'CategoryController@check_slug')->name('categories.check_slug'); 8 | Route::get('categories/{slug}/{category}', 'CategoryController@show')->name('categories.show'); 9 | Route::get('tags/check_slug', 'TagController@check_slug')->name('tags.check_slug'); 10 | Route::get('tags/{slug}/{tag}', 'TagController@show')->name('tags.show'); 11 | Route::get('articles/check_slug', 'ArticleController@check_slug')->name('articles.check_slug'); 12 | Route::get('articles/{slug}/{article}', 'ArticleController@show')->name('articles.show'); 13 | Route::get('articles', 'ArticleController@index')->name('articles.index'); 14 | Route::get('faq', 'FaqController@index')->name('faq.index'); 15 | 16 | Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth']], function () { 17 | Route::get('/', 'HomeController@index')->name('home'); 18 | // Permissions 19 | Route::delete('permissions/destroy', 'PermissionsController@massDestroy')->name('permissions.massDestroy'); 20 | Route::resource('permissions', 'PermissionsController'); 21 | 22 | // Roles 23 | Route::delete('roles/destroy', 'RolesController@massDestroy')->name('roles.massDestroy'); 24 | Route::resource('roles', 'RolesController'); 25 | 26 | // Users 27 | Route::delete('users/destroy', 'UsersController@massDestroy')->name('users.massDestroy'); 28 | Route::resource('users', 'UsersController'); 29 | 30 | // Categories 31 | Route::delete('categories/destroy', 'CategoriesController@massDestroy')->name('categories.massDestroy'); 32 | Route::resource('categories', 'CategoriesController'); 33 | 34 | // Tags 35 | Route::delete('tags/destroy', 'TagsController@massDestroy')->name('tags.massDestroy'); 36 | Route::resource('tags', 'TagsController'); 37 | 38 | // Articles 39 | Route::delete('articles/destroy', 'ArticlesController@massDestroy')->name('articles.massDestroy'); 40 | Route::resource('articles', 'ArticlesController'); 41 | 42 | // Faq Categories 43 | Route::delete('faq-categories/destroy', 'FaqCategoryController@massDestroy')->name('faq-categories.massDestroy'); 44 | Route::resource('faq-categories', 'FaqCategoryController'); 45 | 46 | // Faq Questions 47 | Route::delete('faq-questions/destroy', 'FaqQuestionController@massDestroy')->name('faq-questions.massDestroy'); 48 | Route::resource('faq-questions', 'FaqQuestionController'); 49 | }); 50 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Browser/ArticlesTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.articles.index')); 17 | $browser->assertRouteIs('admin.articles.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/CategoriesTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.categories.index')); 17 | $browser->assertRouteIs('admin.categories.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/FaqCategoryTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.faqcategory.index')); 17 | $browser->assertRouteIs('admin.faqcategory.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/FaqQuestionTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.faqquestion.index')); 17 | $browser->assertRouteIs('admin.faqquestion.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/PermissionsTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.permissions.index')); 17 | $browser->assertRouteIs('admin.permissions.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/RolesTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.roles.index')); 17 | $browser->assertRouteIs('admin.roles.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/TagsTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.tags.index')); 17 | $browser->assertRouteIs('admin.tags.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/UsersTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.users.index')); 17 | $browser->assertRouteIs('admin.users.index'); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class))->bootstrap(); 26 | 27 | foreach ($commands as $command) { 28 | $console->call($command); 29 | } 30 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .sass('resources/sass/app.scss', 'public/css'); 16 | --------------------------------------------------------------------------------