a1tem / knowledge-base
Knowledge base management system
Requires
- php: >=7.2
- illuminate/support: ~5|~6|~7
- laravel/passport: ^9.0
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
- dev-master
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/league/flysystem-1.1.4
- dev-dependabot/composer/laravel/framework-6.18.43
- dev-dependabot/composer/phpseclib/phpseclib-2.0.31
- dev-dependabot/npm_and_yarn/axios-0.21.1
This package is auto-updated.
Last update: 2024-10-30 01:26:37 UTC
README
Knowledge base management system.
It's a laravel package that allows you to install the knowledge base management system into your site:
Key features
- Categories
- Categories can have additional fields (text, textarea, number, select, date, checkbox)
- When user creates the article, he should also fill all the additional fields that belong to the category
- Search by article title and content and also by additional fields
- Validation on additional fields
- Pagination
- Fully customizable as you have access to all the Vue components
Demo
Articles
Categories
Installation
Via Composer
$ composer require a1tem/knowledge-base $ php artisan migrate
$ npm add babel-plugin-syntax-dynamic-import babel-plugin-syntax-jsx babel-plugin-transform-vue-jsx eslint eslint-loader eslint-plugin-vue laravel-mix-eslint vue-template-compiler --save-dev $ npm add element-ui axios vue2-editor $ npm install
Passport installation
We use Passport in order to perform the API calls, if you already use passport, just skip this part.
The full installation process can be found in the Passport Docs
After that just add to the Http/Middleware/EncryptCookies.php file:
protected static $serialize = true;
And add to the $except array 'knowledge-base/' of the Http/Middleware/VerifyCsrfToken.php file:
protected $except = [ 'knowledge-base/*' ];
Add this to your main blade file or to the views/layout/app.blade.php if it's not included yet.
<meta name="csrf-token" content="{{ csrf_token() }}">
Usage
First of all we should publish all the package assets, to do so run this command in the console
$ artisan vendor:publish --provider="A1tem\KnowledgeBase\KnowledgeBaseServiceProvider"
The published components will be placed in your resources/js directory. Once the components have been published, you should register them in your resources/js/app.js file somewhere at the top section add:
require('./knowledge-base/knowledge-base');
After that run:
$ npm run dev
Use it with blade files
By default the module will work in NON_SPA mode, it means that you can use it directly by typing the url address:
- To view all categories
/knowledge-base/view/categories
- To view all articles
/knowledge-base/view/articles
You can find all the published view files in the resources/views/vendor/a1tem/knowledge-base folder and modify the style as you want.
Also you are able to modify the VUE files as well, to find them navigate to resources/js/knowledge-base/views folder.
Don't forget to rebuild the assets by running npm run dev after modifying the vue files.
Use it in the SPA applications
- If you want to use this package in the SPA mode, you have to change in the knowledge-base/config.js file:
MODE: MODE_SPA
- Then you have to include in your router file:
import { KNOWLEDGE_BASE_ROUTER } from './knowledge-base/knowledge-base-router'; export default new VueRouter({ mode: 'history', linkActiveClass: 'active', routes: [ { path: '/', component: Vue.component('Layout', require('./Layout.vue').default), children: [ // Your routes here ].concat(KNOWLEDGE_BASE_ROUTER), }, ], });
You can examine the 'knowledge-base/knowledge-base-router.js' file and change it in the way that the best suited for your application.
Configuration
You can configure different aspects of the package, check config/knowledge-base.php file.
Testing
$ composer phpunit or $ vendor/bin/phpunit
Security
If you discover any security related issues, please email artempetrusenko@gmail.com instead of using the issue tracker.
Credits
Built with
Laravel - The PHP Framework For Web Artisans
VueJS - The Progressive JavaScript Framework
Element - A Vue 2.0 based component library for developers, designers and product managers
Vue2Editor - Vue.js editor for rich text editing built with Vue.js and Quill.js
License
Knowledge base system is open-sourced software licensed under the MIT license.