Download the PHP package silvertipsoftware/rest-router without Composer

On this page you can find all versions of the php package silvertipsoftware/rest-router. 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 rest-router

RestRouter

About

The rest-router package allows you to construct urls by passing in an Eloquent model or corresponding class name.

Features

Installation

Require the silvertipsoftware/rest-router package in your composer.json and update your dependencies:

The package can be used by directly calling url() or path() on SilvertipSoftware\RestRouter\RestRouter, but for convenience, a mixin for Laravel's built-in URL facade is provided. To use, in your RouteServiceProvider::boot method, call:

The url() and path() methods will now be available on URL.

Usage

RestRouter is built primarily to work on routes defined with the Route::resource() method of Laravel's router, although hand-rolled routes can also be used. Behind the scenes, RestRouter uses the route names to create urls; the actual text of the url is irrelevant.

Simple Resource Routes

Assume that the following resource has been defined:

Then in your code you can do:

Fallbacks

Not every REST action need be defined on a resource. RestRouter will check other route names which generate the same url, since it is not concerned with the HTTP method used. For example:

Prefixed Resource Routes

RestRouter needs to be given any route name prefixes (not uri prefixes) defined. For example:

Non-REST Actions

If you've defined non-typical REST actions on your resource, you can pass an action option to RestRouter to find that route name. For example:

Nested Resources

RestRouter assumes shallow resources by default. If you use nested resources, this can be enabled globally or on a per-route basis.

For enabling nested resource support globally, in your RouteServiceProvider insert:

On a per-route basis, pass a "shallow" => false option to your call to url() or path() as below. For example:

Route Generation Options

If the last argument is an array, it is treated as a keyed array of options to modify the url. Available options are:

Any other keys added to the $options parameter are treated as either query parameters for the generated url, or as route parameters if they are defined.

Also works in blade templates:

will render to:

License

Released under the MIT License, see LICENSE.


All versions of rest-router with dependencies

PHP Build Version
Package Version
No informations.
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 silvertipsoftware/rest-router contains the following files

Loading the files please wait ....