Download the PHP package macellan/laravel-advanced-route without Composer

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

Laravel Advanced Route

An advanced route for Laravel 5.3, 5.4, 5.5, 5.6, 5.8, 6.0, 7.0, 8.0, 9.0 to support controllers

Background

In Laravel the advanced functionality Route::controller was removed. This class fixes this shortcoming.

Reason

The default router is sufficient for small projects. Once the project starts to grow, placing all possible route definitions in the router file start to become harder to understand and follow. Quite often the router file becomes so messy, that the developer is afraid to modify/remove routes (even if these might be unused) in order to not break the application unexpectedly.

The AdvancedRoute::controller gives the control to the controller itself, and makes each controller responsible for its own routing (destiny).

Specifying the controller methods with get/post/any prefixes improves readability, and allows to easily understand what HTTP method is being used to call the functionality just by viewing the method.

Does your router file not fit the screen and you have to scroll to see all routes? Have you split your routes in separate router files, and included these in one router files? Do you not feel comfortable removing routes, as these might be used somewhere? Do you use names to "name" your routes? Then its time to think outside the box and go advanced.

How it works

The advanced route allows you to easily define a single route to handle every action in a controller class. First, define the route using the AdvancedRoute::controller method. The controller method accepts two arguments. The first is the base URI the controller handles, while the second is the class name of the controller. Next, just add methods to your controller. The method names should begin with the HTTP verb they respond to followed by the title case version of the URI.

Installation

a) via composer (recommended)

b) manually

Add the following to your composer file:

Usage

Add the following line to where you want your controller to be mapped:

Full Example:

Multiple controllers mapping:

Missing method

If you have a controller with a few predefined routes, you can add the missingMethod() to handle all undefined sub-paths for that controller's path.

Acknowledgements

Laravel Advanced Route is only possible thanks to all the awesome contributors!

Alternatives

Is Laravel too bloated and slow, yes tell me about it? You want to go down the pure PHP route? Well, here are some notable packages, which will allow you to keep the niceties of the Larael routing:

https://github.com/mrjgreen/phroute


All versions of laravel-advanced-route with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version >=5.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 macellan/laravel-advanced-route contains the following files

Loading the files please wait ....