A simple, flexible, and customizable FAQ management package for Laravel.
Built with tagging, sorting, and localization in mind.
Developed by Bensondevs
- Add FAQs with or without tags
- Tag-based filtering
- Multi-lingual question & answer support (via
spatie/laravel-translatable
) - Sortable (via
spatie/eloquent-sortable
) - API-ready with Resources
- Easy integration into existing Laravel apps
- Workbench support for local testing
Require the package via Composer:
composer require bensondevs/laravel-faq
Publish config & migrations:
# Publish config file
php artisan vendor:publish --tag=faq-config
# Publish migrations file
php artisan vendor:publish --tag=faq-migrations
The default config file config/faq.php
will be published. You can customize table names and other options there.
use Bensondevs\LaravelFaq\Faq;
$faq = Faq::add('What is Laravel?', 'Laravel is a PHP framework.');
$faq = Faq::add(
question: 'What is PHP?',
answer: 'A scripting language.',
locale: 'en',
tag: 'php',
);
$faq = Faq::add(
question: 'What is Tailwind?',
answer: 'A CSS framework.',
locale: 'en',
tag: ['css', 'tailwind'],
);
Faq::all(); // returns FaqResource::collection
use Bensondevs\LaravelFaq\Models\Tag;
Faq::all('php');
Faq::all(Tag::first());
Faq::all(['php', 'laravel']);
This package uses Orchestra Testbench.
Run all tests:
./vendor/bin/phpunit
This package uses Laravel Pint for formatting.
To auto-format your code:
./vendor/bin/pint
This package is open-sourced software licensed under the MIT license.
- Simeon Bensona
- Spatie for translatable & sortable packages
- Laravel community