- Does **in10/styleguide** work with Laravel 8/9/10 or only older versions?
- The package was last updated in 2019, so it likely targets Laravel 5.x–7.x. Test it in a staging environment with your Laravel version to confirm compatibility, especially for Blade syntax or routing changes. If issues arise, check for forks or consider alternatives like Storybook for modern Laravel.
- How do I set up the `/styleguide` route in Laravel?
- Add a route in `routes/web.php` like this: `Route::prefix('styleguide')->group(function () { Route::get('/', function () { return view('styleguide.index'); }); });`. The package doesn’t auto-register routes, so manual setup is required. Ensure no conflicts with existing `/styleguide` routes in your app.
- Can I use this for dynamic UI components with props or variants?
- No, **in10/styleguide** is purely static—it renders Blade templates without interactive props or theming. For dynamic components, consider Storybook or Zeroheight. This package is best for documenting finished UI patterns, not development previews.
- Is there a way to share the styleguide externally (e.g., with clients)?
- Yes, host the `/styleguide` route on your production server or staging environment. Since it’s server-rendered HTML, no additional setup is needed. Just ensure the Blade templates are accessible via the route. Avoid exposing sensitive internal docs.
- Will this package break if I upgrade PHP to 8.0+?
- Potential risks exist since the package predates PHP 8.0. Test for deprecated functions or syntax (e.g., `@each` loops, `extract()`). If errors occur, check the package’s `composer.json` for PHP version constraints or fork it for updates.
- How do I structure my Blade templates for a scalable styleguide?
- Organize templates in `resources/views/styleguide/` with modular files (e.g., `_header.blade.php`, `buttons.blade.php`). Use `@include` for shared components. Start with a simple `index.blade.php` to list all patterns. Avoid deep nesting to keep templates maintainable.
- Are there alternatives if this package isn’t maintained?
- For lightweight docs, try **Laravel Zeroheight** or **Storybook** (with Laravel integrations). For minimalism, manually create a `/styleguide` route with Blade. If you need interactivity, Storybook is the gold standard, but it requires Node.js setup.
- Can I add CSS/JS to styleguide pages without bloating my app?
- Yes, include assets via Blade (e.g., `@vite(['resources/css/styleguide.css'])`) or use inline styles. For JS, keep it minimal—this isn’t a SPA. Avoid global styles; scope CSS to `.styleguide-*` classes to prevent leaks into your main app.
- How do I test the styleguide in CI or local development?
- Add a test route or script to verify `/styleguide` renders without errors. Use Laravel’s `artisan route:list` to check the route exists. For CI, run a curl request or browser test in a headless environment. Mock Blade templates if needed.
- Is the package secure? Should I scan it for vulnerabilities?
- Run `composer audit` to check for known vulnerabilities. Since it’s lightweight and server-side, risks are low, but outdated dependencies (e.g., Carbon <9.0) could pose issues. If using PHP 8.0+, audit for deprecated functions that might introduce security gaps.