Download the PHP package kirago/laravel-routify without Composer

On this page you can find all versions of the php package kirago/laravel-routify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-routify

Laravel Routify

Packagist Version Tests Code Style Total Downloads

Auto-discover and register Laravel route files spread across multiple folders. Configurable glob patterns, middleware groups, stacks (web / api / console / channels — or your own), opt-in filesystem cache, and a fluent builder for the cases the config can't express.


Why this package

The pain: routes/api.php rots

In a fresh Laravel app, every API route lives in routes/api.php. That file keeps growing. By the time the app has billing, auth, inventory, users, notifications and a few admin endpoints, it looks like this:

Pull-request reviews on this file are painful. Merge conflicts are constant. Finding "where is the route for X" requires grep. Multiply by web.php, console.php, channels.php and any custom stack (admin, internal, …) and the boilerplate compounds.

The disciplined workaround that's still painful

The seasoned move is to split per feature and require each piece manually from a central group:

Or worse — the same boilerplate inflated inside a RouteServiceProvider with five Route::group(…)->group(__DIR__.'/…') chains, one per feature folder.

It's better than the giant file, but every new module forces a touch on this central index. Forget the line and the routes silently disappear in production. That last part is the killer: there's no compiler error, no test failure unless you remembered to write one — just a 404 on staging at 9 PM the day before launch.

What Routify does

Point Routify at a folder, drop your route files anywhere underneath, stop maintaining the index:

The "register every file by hand" tax is gone.


Installation

The package auto-registers via Laravel's package discovery. Publish the config to customise it:

Requires PHP 8.2+ and Laravel 11, 12 or 13.

Zero-crash install — the shipped config has paths => []. The package is wired but does nothing until you point it at the directories your app uses. No surprise exceptions on first boot.


Quick start

  1. Add your route directories to config/routify.php:

  2. Drop route files anywhere under those roots:

…and they all become api/invoices, api/v2/* etc. with the api middleware group applied. With auto_discover_on_boot = true (the default), that's it — no extra wiring.

Folder-based discovery — drop a file, get a route

Since 1.1, you don't have to name your route files api*.php or web*.php anymore. Drop them in a folder named after the stack and Routify picks them up. The two modes coexist; pick whichever fits.

The rule is: under any paths[] directory, a .php file whose relative path contains a segment exactly equal to a declared stack key (api, web, your own admin, …) belongs to that stack — at any depth, with that stack's middleware, prefix, name prefix and domain applied automatically.

Conventions are simpler than configs: no rename of existing files, no central index to maintain, and a custom stack works as soon as the folder exists.

Migration note. If a folder under your scanned paths[] happens to be named after a stack key (api/, web/, …) and contains non-route PHP files (helpers, classes you forgot to namespace, …), those files will now be loaded as routes. Either narrow your paths config or rename the folder.

Explicit discovery for advanced setups

For explicit control, set auto_discover_on_boot => false and call from your AppServiceProvider::boot() (recommended location — facades are guaranteed to be ready there):


Configuration

config/routify.php:

Custom stacks

Declare anything you want — routify does not assume web and api are the only valid stacks:

Then load it explicitly:

Multiple paths

Each path is scanned independently. If two paths overlap, the same file is registered exactly once.


Fluent builder

For the cases the config can't express:

Every method returns the builder, so order is irrelevant. load() is the terminal call.


Artisan commands

routify:cache, routify:clear and routify:optimize only do useful work when routify.cache.enabled is true (typically ROUTIFY_CACHE=true in production). The cache is on the filesystem scan — Laravel's own route:cache is orthogonal and complementary.


Production deployment

In production, scanning the filesystem on every boot is wasteful. Enable the cache and warm it at deploy time:

Add the warm-up to the deployment script alongside the standard Laravel optimisations:

CI/CD via Composer scripts

To trigger Routify's cache refresh automatically on composer install / composer update, add this to your application's composer.json (not the package — Composer scripts live in the consuming app):

The routify:optimize call is a no-op when the cache is disabled, so it is safe to keep enabled across all environments.


Security considerations

Routify requires the route files it discovers. The same trust model as Laravel's own routes/ directory applies — with one important shift: the list of paths now comes from your config, so the surface for misconfig is larger. Keep these in mind:

In short: treat routify.paths like you treat the routes/ directory. Don't stage anything writable by the runtime web user under it.


Testing


Architecture

The why-and-how of every architectural choice is documented as Architecture Decision Records under docs/adr/ (in French). Start with ADR-0001 — Layered architecture for the big picture.


Roadmap

Post-1.0 ideas, not committed:


Contributing

Issues and pull requests on GitHub are welcome. Please run composer test and composer format:test before submitting.


License

MIT — see Simo Joel.


All versions of laravel-routify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
symfony/finder Version ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kirago/laravel-routify contains the following files

Loading the files please wait ...