- How do I install jeffersongoncalves/laravel-faq in a Laravel application?
- Install it with Composer by running composer require jeffersongoncalves/laravel-faq. The package is Laravel-native, so its service provider is discovered automatically. After that, publish the config and migrations, then run php artisan migrate to create the FAQ tables. From there you can seed or create categories and questions through the provided Eloquent models.
- Does the package ship its own migrations and models?
- Yes. It includes publishable migrations and ready-to-use Eloquent models for FAQ categories and question/answer entries, so you do not have to design the data layer yourself. You publish the migrations, run them, and then extend the models if you need extra fields or relationships. If you already have FAQ tables, reconcile the published migration with your existing schema before running it.
- How do categories and sort ordering work?
- Each FAQ entry can be grouped into a category, which keeps long lists organized for both browsing and filtering. The package includes a sort order column so you can control exactly where each question appears within its list. There is also an active/inactive flag, so you can hide entries without deleting them. You control ordering by setting the sort value on each record and ordering your query accordingly.
- Which Laravel and PHP versions are supported?
- The package is installed via Composer and targets modern Laravel applications, but the authoritative answer is the require block in its composer.json. Check the version constraints for laravel/framework, php, and any dependencies on Packagist before adopting it, especially for version 1.0.0. If you are on the newest Laravel release, verify compatibility in a branch first rather than assuming broad support.
- How does the package handle multiple languages and translations?
- Translatable fields are stored through spatie/laravel-translatable, which keeps translations in JSON columns rather than a separate translations table. That means locale-filtered queries cannot use ordinary indexes unless you add generated columns or per-locale extracts, so plan your query patterns accordingly. Spatie's fallback behavior silently returns the fallback locale when a translation is missing, so add observability for missing translations if you serve multiple locales. Confirm the spatie major version required by 1.0.0 does not clash with other packages in your app.
- Is there an admin panel or CRUD interface included?
- The package focuses on the data layer: migrations, models, config, and helpers for querying FAQs. It does not appear to ship a full admin UI, so you either build a simple CRUD screen with Laravel or manage content through seeders and imports. Confirm the contents of 1.0.0 before planning around any management surface.
- How do I query only active FAQs, and can I filter by category?
- Use the active/inactive visibility flag in your Eloquent query, for example filtering where active is true and ordering by the sort column. Category grouping is a relationship, so you can constrain queries by category or eager-load categories to avoid N+1 problems. Return the results as a collection for Blade or as JSON for an API endpoint. If you cache the output, remember to clear it whenever FAQ content changes.
- How should I test the FAQ package in my Laravel test suite?
- Use an in-memory SQLite database or a dedicated test database with RefreshDatabase, and run the package migrations in your test setup. Then write feature tests that create categories and questions through the models and assert your controllers return only active, correctly ordered entries. Test locale fallback explicitly by requesting a locale with missing translations, and assert the behavior you actually want. If production runs MySQL or Postgres, add at least one integration test against that engine to catch JSON column differences.
- Can I adopt it in an existing app that already has FAQ content?
- Yes, but treat it as a data migration rather than a drop-in install. Inventory your existing FAQ storage, map rows into the package's category and question tables, and preserve existing IDs or URL slugs so you do not break indexed pages. Run both systems behind a feature flag with redirects during cutover, and only then remove the old tables. If your FAQs are marketing copy, also consider whether a CMS is a better long-term home than app-owned data.
- Is the package actively maintained, and what are the alternatives?
- This is a single-author package, so check the GitHub repository for recent commits, open issues, and release cadence before committing to it, and confirm the license on Packagist. If maintenance slows, the models and migrations are simple enough to fork or replace. Alternatives include building the same tables yourself, using a CMS or headless content service for marketing-owned FAQs, or pairing your own models with spatie/laravel-translatable.