Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Folio Laravel Package

laravel/folio

Laravel Folio is a page-based router for Laravel that lets you define routes by creating files, keeping routing simple and organized. Ideal for building pages quickly with less boilerplate, backed by official Laravel documentation and support.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Content-Heavy Applications: Enables rapid development of CMS-like systems (e.g., marketing sites, blogs, or internal portals) by automating route generation from a database of pages. Reduces manual route definitions and simplifies dynamic content management.
  • Build vs. Buy Decision: Buy for teams needing a lightweight, Laravel-native solution for page-based routing instead of building custom routing logic or adopting full-fledged CMS platforms (e.g., WordPress, Strapi). Ideal for projects where routing is dynamic but a heavy CMS is overkill.
  • Roadmap Priorities:
    • Phase 1: Launch a "Pages" feature for marketing sites (e.g., /about, /blog) using Folio’s file-based routing system, reducing development time for static content pages.
    • Phase 2: Integrate Folio with Laravel Nova or Forge to enable non-technical users to manage pages via an admin interface, leveraging Folio’s folio:list and folio:install commands.
    • Phase 3: Extend Folio for multi-language support by leveraging its domain and middleware features (e.g., /en/about, /es/about) to support internationalized content.
  • Use Cases:
    • Marketing and Landing Pages: Dynamically generate routes for promotional content without manual route definitions.
    • Internal Documentation/Wikis: Create a self-service portal where content editors can manage pages via a simple file structure.
    • Legacy System Modernization: Replace hardcoded routes in older Laravel applications with a more maintainable, database-driven approach.
    • Multi-Tenant Applications: Use Folio’s domain support to route tenants to their respective pages (e.g., tenant1.example.com/dashboard).

When to Consider This Package

  • Adopt Folio if:

    • Your application requires file-based routing where pages are mapped directly to files in a directory structure (e.g., resources/pages/about.blade.php maps to /about).
    • You need dynamic route generation without manually defining routes in routes/web.php, especially for content-heavy applications like blogs, marketing sites, or internal portals.
    • Your team prefers Laravel-native solutions over third-party CMS platforms for simplicity and integration with existing Laravel features (e.g., Blade templates, middleware, events).
    • You want to reduce boilerplate for common page structures (e.g., nested routes like /blog/post/{slug}) while maintaining flexibility.
    • Your application requires support for multiple domains or subdomains with overlapping paths (e.g., admin.example.com vs. app.example.com).
    • You are using Laravel 11+ and want a routing solution that aligns with modern Laravel practices and is actively maintained.
  • Look Elsewhere if:

    • Your application requires complex API-driven routing (e.g., GraphQL, RESTful APIs with custom logic). Folio is optimized for page-based routing, not API endpoints.
    • You need advanced CMS features like user roles, workflows, or versioning beyond what Folio’s file-based system offers. Consider platforms like Strapi, Craft CMS, or WordPress.
    • Your team is heavily invested in database-driven routing with custom logic (e.g., routes stored in a routes table with arbitrary conditions). Folio’s file-based approach may not fit.
    • You require real-time collaboration or WYSIWYG editing for content, which Folio does not natively support (though it can integrate with other tools).
    • Your application is not Laravel-based or uses an older version of Laravel (Folio supports Laravel 11+).
    • You need highly customized route matching logic that cannot be achieved with Folio’s built-in features (e.g., regex-based routes with specific constraints).

How to Pitch It (Stakeholders)

For Executives:

"Folio is a game-changer for our content-heavy applications, like our marketing site or internal knowledge base. It replaces manual route definitions with a file-based system, cutting development time by 40% for static pages while keeping everything Laravel-native. For example, instead of writing 20+ route definitions in routes/web.php for our blog, we’ll map them directly to files in resources/pages. This also makes it easier for non-technical teams to manage content—imagine our marketing team updating landing pages without touching code. Plus, it integrates seamlessly with our existing Laravel stack, reducing risk and complexity. We’re targeting this for our Q3 roadmap to accelerate the launch of our new customer portal."

For Engineering Teams:

*"Folio is a lightweight, file-based router for Laravel that automates route generation from a directory structure (e.g., resources/pages/about.blade.php/about). Here’s why it’s a win:

  • Reduces Boilerplate: No more manually defining routes for static pages. Just drop a Blade file in the right folder, and Folio handles the rest.
  • Dynamic Content: Supports nested routes (e.g., /blog/{slug}) and model binding out of the box. Perfect for blogs, marketing sites, or internal wikis.
  • Laravel Integration: Works with middleware, events (e.g., ViewMatched), and Blade directives like @route. Even supports multi-domain routing and terminable middleware.
  • Performance: Lazy-loaded commands and optimized for Laravel 11+. No bloat—just what you need for page-based routing.
  • Future-Proof: Actively maintained by the Laravel team, with support for PHP 8.4+, Laravel 12/13, and upcoming features like Boost Guidelines.

Use Case: Replace our current /about, /careers routes with Folio’s file system. For the blog, we’ll map resources/pages/blog/{slug}.blade.php to /blog/{slug}. This cuts route management time and makes it easier to add new pages. We can also extend it later for multi-language support via domains (e.g., /es/about). Let’s prototype this for the marketing site in the next sprint."*

For Developers:

*"Folio is a minimalist, file-based router for Laravel that’s perfect if you’re tired of manually defining routes for static pages. Here’s how it works:

  • File-Based Routing: Create a resources/pages directory. Files like about.blade.php automatically map to /about. Nested folders create nested routes (e.g., blog/post.blade.php/blog/post).
  • Model Binding: Supports route model binding (e.g., resources/pages/posts/{post}.blade.php binds to a Post model).
  • Blade Helpers: Use @route directives in Blade templates for clean URL generation (e.g., @route('about')).
  • Middleware & Events: Apply middleware to routes or listen for ViewMatched events. Supports terminable middleware and domain-specific routing.
  • CLI Tools: Generate routes with php artisan folio:list, install Folio with php artisan folio:install, and more.

Why Use It?

  • No more Route::get('/about', ...) for static pages.
  • Easier to maintain than a custom router or a heavy CMS.
  • Integrates with Laravel’s ecosystem (e.g., works with route:cache, route:list).

Example Workflow:

  1. Create resources/pages/contact.blade.php.
  2. Folio automatically routes /contact to this file.
  3. Use @route('contact') in your layout for navigation links.

Let’s use this for the new marketing site to simplify route management. We can start by migrating /about and /careers to Folio’s file system and then expand to the blog."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope