Download the PHP package geckods/laravel-routes without Composer

On this page you can find all versions of the php package geckods/laravel-routes. 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-routes

[![GitHub License](https://img.shields.io/github/license/Gecko-Digital-Solutions/laravel-routes?labelColor=2d2d2d)](LICENSE) [![Packagist Version](https://img.shields.io/packagist/v/geckods/laravel-routes?label=Composer&logo=composer&logoColor=white&labelColor=2d2d2d)](https://packagist.org/packages/geckods/laravel-routes) [![PHP Version](https://img.shields.io/packagist/php-v/geckods/laravel-routes?logo=php&logoColor=w3F448Dhite&labelColor=2d2d2d&color=3F448D)](composer.json) ![Laravel](https://img.shields.io/packagist/dependency-v/geckods/laravel-routes/laravel/framework?label=Laravel&logo=laravel&logoColor=FF2D20&labelColor=2d2d2d&color=FF2D20) [![Tests](https://github.com/Gecko-Digital-Solutions/laravel-routes/actions/workflows/ci.yml/badge.svg)](https://github.com/Gecko-Digital-Solutions/laravel-routes/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/Gecko-Digital-Solutions/laravel-routes/badge.svg?branch=main)](https://coveralls.io/github/Gecko-Digital-Solutions/laravel-routes?branch=main)

Laravel Routes

Overview

Laravel Routes is a lightweight Laravel package that helps you organize application routes by feature or functionality instead of keeping them all in a single centralized file. This approach promotes better code organization, maintainability, and scalability in larger Laravel projects.

Why Use Laravel Routes?

Requirements

Installation

Install the package via Composer:

The package will be automatically registered through Laravel's auto-discovery feature. No manual service provider registration is needed.

Configuration

Publish Config File

Publish the configuration file to your application:

This creates config/routes.php with the following options:

Auto-Publishing on Update

To automatically publish the config on each Composer update, add this to your composer.json:

Usage

Basic Setup

In your route files (e.g., routes/api.php or routes/web.php), initialize the route controller:

Creating Route Classes

Create route classes by extending AbstractRouteController:

Another example with different middleware:

How Route Discovery Works

The package uses glob patterns to discover route files. Here's how it works:

  1. Uses the path config to find PHP files
  2. Converts file paths to class names using prefix_namespace config
  3. Requires the file and checks if the class exists
  4. Verifies the class extends AbstractRouteController
  5. Instantiates the class and calls handle()

Example Mapping

With default config:

A file at app/Http/Routes/UserRoutes.php containing class App\Http\Routes\UserRoutes will be discovered.

Configuration Options Explained

path

Defines where the package searches for route classes. Supports standard glob patterns.

The glob patterns work as follows:

Examples:

prefix_namespace

The namespace prefix that will be prepended to the discovered class names. This must match your actual class namespaces.

When the package discovers a file, it:

  1. Gets the relative path from app directory
  2. Replaces slashes with backslashes
  3. Removes the .php extension
  4. Prepends the prefix_namespace

Examples:

other_routes

Manually register route classes that either:

Usage:

Project Structure Example

A typical project structure might look like:

Then in routes/api.php:

With config:

The package will discover and execute:

Advanced Usage

Conditional Route Registration

Register routes conditionally based on environment or feature flags:

Nested Route Groups

Organize complex route hierarchies:

Testing

The package includes a comprehensive test suite with 27 tests covering:

Running Tests

For detailed testing documentation, see TESTING.md.

Documentation

Migration from Other Packages

If you are migrating from centralized route files:

  1. Create route classes in your desired structure
  2. Extend AbstractRouteController with your route definitions
  3. Update route files to use RouteController::handle()
  4. Test thoroughly to ensure all routes work as expected

Performance Considerations

Troubleshooting

Routes Not Being Discovered

  1. Check that your route class extends AbstractRouteController
  2. Verify the path config matches your route class locations
  3. Ensure the prefix_namespace config is correct
  4. Run php artisan config:clear to clear cached config
  5. Verify the class namespace matches what the discovery algorithm produces

Namespace Errors

  1. Verify class namespace matches prefix_namespace config
  2. Check that files are in the location specified by path config
  3. Ensure autoloader is updated: composer dump-autoload

Routes Not Executing

  1. Confirm RouteController::handle() is called in your route files
  2. Check middleware order and authentication requirements
  3. Verify route controller has a valid handle() method

Contributing

Contributions are welcome! Please feel free to submit a Pull Request to the GitHub repository.

Development Setup

Support

For issues, questions, or suggestions, please open an issue on the GitHub repository.

License

This package is open source software licensed under the MIT license.

About

Created and maintained by Gecko Digital Solutions.

Last Updated: November 2025 Version: 1.0.0


All versions of laravel-routes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^10.0 || ^11.0 || ^12.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 geckods/laravel-routes contains the following files

Loading the files please wait ...