Installation
install by composer
composer require virtualorz/faq
edit config/app.php
'providers' => [
...
Virtualorz\Fileupload\FileuploadServiceProvider::class,
Virtualorz\Cate\CateServiceProvider::class,
Virtualorz\Faq\FaqServiceProvider::class,
Virtualorz\Pagination\PaginationServiceProvider::class,
...
]
'aliases' => [
...
'Fileupload' => Virtualorz\Fileupload\FileuploadFacade::class,
'Cate' => Virtualorz\Cate\CateFacade::class,
'Faq' => Virtualorz\Faq\FaqFacade::class,
'Pagination' => Virtualorz\Pagination\PaginationFacade::class,
...
]
migration db table
php artisan migrate
usage
1. get cate list data
$dataSet = Faq::list('use type');
use type : eg. news, member , product ...etc, different type in your application
$dataSet : return date, (*1)
2. add data to cate
Faq::add('use type');
with request variable name required : faq-cate_id,faq-title,faq-answer,faq-order,faq-enable, (*2)
3. get cate detail
$dataRow = Faq::detail($faq_id);
4. edit data to cate
Faq::edit();
with request variable name required : faq-cate_id,faq-title,faq-answer,faq-order,faq-enable, (*3)
5. delete cate data
Faq::delete();
with request variable name required : id as integer or id as array, (*4)
6. enable cate data
Faq::enable($type);
with request variable name required : id as integer or id as array
$type is 0 or1 , 0 to disable i to enable, (*5)