Download the PHP package florddev/laravel-auto-routing without Composer

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

Laravel Auto Routing

Laravel Auto Routing is a package that simplifies route creation in your Laravel applications using PHP 8 attributes and intuitive naming conventions, while remaining compatible with Laravel's existing routing features.

Features

Requirements

Installation

  1. Install the package via Composer:

  2. Add the service provider to your config/app.php file:

Basic Usage

In your route file (e.g., routes/web.php), use the auto method to automatically register routes for a controller:

In your controller, use attributes to define HTTP methods:

Generated Routes

Here's an example of routes generated for a basic controller:

Action Generated Route HTTP Method Route Name
index /users GET users.index
show /users/show/{id} GET users.show
store /users/store POST users.store
update /users/update/{id} PUT users.update
destroy /users/destroy/{id} DELETE users.destroy

Note: The index method is automatically mapped to the root of the controller's prefix.

Advanced Usage

Adding Options

You can add additional options such as middlewares or prefixes:

Optional Parameters

The package automatically handles optional parameters:

This will generate a route: GET /api/search/{query}/{page?}/{sort?}

Method-Level Route Configuration

You can customize any valid Laravel route option using attribute parameters:

Controller-Level Route Configuration

You can now use the ControllerRoute attribute to configure routes at the controller level:

This will apply any valid Laravel route option as an attribute parameter in the controller.

Using with Laravel Route Groups

Laravel Auto Routing works seamlessly with Laravel's route groups:

Auto-routing a directory

You can generate routes for all controllers in a specific directory:

This will generate routes for all controllers in the /app/Http/Controllers directory.

When auto-routing a directory, you can exclude specific controllers or subdirectories:

This will generate routes for all controllers in the /app/Http/Controllers directory, except for ProfileController and any controllers in the Api subdirectory.

Creating Auto-Routed Controllers

You can create a new controller with auto-routing methods using the following Artisan command:

This will generate a new controller with basic CRUD methods already set up with the appropriate auto-routing attributes.

If you want to create a resource controller with all resource methods and auto-routing, use both the --resource and --auto options:

After creating the controller, don't forget to register it in your routes file:

Contributing

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

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-auto-routing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^8.0|^9.0|^10.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 florddev/laravel-auto-routing contains the following files

Loading the files please wait ....