Download the PHP package jalameta/jps-router without Composer

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

JPS Router

Laravel custom route wrapper by PT. Jalameta Pilar Sinergis.

Installation

Using composer:

composer require jalameta/jps-router

Applying into your project

Laravel >= 5.8

Laravel <= 5.8

Run command in your project

php artisan jps:routes --install

If you deciding to remove the original laravel routes, you might add --remove option within the command. So the command will be

php artisan jps:routes --install --remove

JPS Router will configure the routes for you, the Laravel default routes folder will be deleted. So backup your defined routes first.

Usage

Creating new route

To make a new route just run: php artisan make:route DefaultRoute After running command above, the route named DefaultRoute will appear in app/Http/Routes/DefaultRoute.php. After creating routes, it will not be loaded automatically, you must register the Route Class in the route configuration.

make:route options
  1. Inject Inject is useful options to auto adding the route class name within route configuration, so you don't need to add it manually. E.g: php artisan make:route DefaultRoute --inject web Command above will make the Default route within the web groups that defined in config/routes.php.

  2. Controller The controller option will generate the route and the controller used by the route. So you don't need to run 2 artisan command to create a new controller and route. php artisan make:route DefaultRoute --controller HomeController

  3. Help Shows JPS router command helps

Routes Configuration

Below is an example of JPS router configurations.

As you can see, groups index is group configuration, you can pass any laravel options there such as as, domain, middleware, prefix, etc. Afterward, the web and api are group index defined before in the groups index. It is an array of route class names.

Class Structure

After creating a route with the command, we will see the example of the generated file.

After creating a route with the command, we will see the example of the generated file. We can define routes within the register method. All you need is to call $this->router as a router instance. Then, we can invoke the laravel routing method such as post, put, etc. See Laravel Routing Docs.

Using Controller

From create route command, we know we can pass the controller namespace. The created controller will show up in the route class as a controller method.

The route above is equal with

This package want to solve those duplicated namespace and class name several times as we define the routes. Or if you don't want to use the controller in the route class, you can pass the second parameter of $this->uses() method with the controller class name to be used, E.g : $this->uses('login', LoginController::class).

Route Prefix

Override the route prefix defined in the class property. Default prefix is '/';

protected $prefix = '/home';

The route above is equal with

Route Name

You need to define the route name property within the route class

protected $name = 'home';

Later we can use $this->name() method for adding separation with dot (.) between the route group name and the single route name

It equal with


All versions of jps-router with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version >=5.6
illuminate/console Version >=5.6
illuminate/routing Version >=5.6
illuminate/filesystem Version >=5.6
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 jalameta/jps-router contains the following files

Loading the files please wait ....