PHP code example of misaf / vendra-faq
1. Go to this page and download the library: Download misaf/vendra-faq library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
misaf / vendra-faq example snippets
use Misaf\VendraFaq\Models\FaqCategory;
$category = FaqCategory::query()->create([
'name' => ['en' => 'General'],
'description' => ['en' => 'General questions'],
'slug' => ['en' => 'general'],
'position' => 1,
'active' => true,
]);
use Misaf\VendraFaq\Models\Faq;
Faq::query()->create([
'faq_category_id' => $category->id,
'name' => ['en' => 'How do I create an account?'],
'description' => ['en' => 'Use the register page and verify your email.'],
'slug' => ['en' => 'how-do-i-create-an-account'],
'position' => 1,
'active' => true,
]);
$faqs = Faq::query()
->with('faqCategory')
->where('active', true)
->get();
use Misaf\VendraTagger\Models\Tagger;
Tagger::findOrCreate('Account', type: 'faq', locale: 'en');
bash
composer vendor:publish --tag=vendra-faq-migrations
php artisan migrate
bash
php artisan vendor:publish --tag=vendra-faq-translations
bash
php artisan test --compact --testsuite=vendra-faq
composer stan