2017 © Pedro Peláez
 

library json-routes

Define your routes in laravel using JSON files

image

fire015/json-routes

Define your routes in laravel using JSON files

  • Monday, December 29, 2014
  • by fire015
  • Repository
  • 1 Watchers
  • 3 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

json-routes

Total Downloads Build Status, (*1)

Define your routes in Laravel using JSON files., (*2)

Installation

PHP 5.4+, Laravel 4.2+, and Composer are required., (*3)

To get the latest version of JSON Routes, simply add the following line to the require block of your composer.json file:, (*4)

"fire015/json-routes": "~1.0"

You'll then need to run composer install or composer update to download it and have the autoloader updated., (*5)

Once JSON Routes is installed, you need to register the service provider. Open up app/config/app.php and add the following to the providers key., (*6)

'Fire015\JsonRoutes\JsonRoutesServiceProvider', (*7)

Configuration

To get started, first publish the package config file:, (*8)

$ php artisan config:publish fire015/json-routes

This will create a config file which allows you to define the path to the JSON files (by default this is a folder within app/config called routes)., (*9)

Usage

Presuming we have created the app/config/routes folder as specified above, create a file in that folder called routes.json where we can define our routes. Here is an example of that file:, (*10)

{
    "GET": {
        "/": {
            "uses": "HomeController@showIndex"
        },
        "about": {
            "uses": "AboutController@showIndex"
        }
    },
    "POST": {
        "user/{id}": {
            "uses": "UserController@storeUser"
        }
    }
}

You simply define the route URI as the key under each method and the usual route options as if it were an array in the Route::(get|post|put|patch|delete|options) static methods., (*11)

You can also split your routes up into sub-files and folders. For example you can define user/account in any of the following places:, (*12)

  • /user.json
  • /user/routes.json
  • /user/account.json
  • /user/account/routes.json

The Versions

29/12 2014

dev-master

9999999-dev

Define your routes in laravel using JSON files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jason M

laravel json route router

29/12 2014

v1.0.0

1.0.0.0

Define your routes in laravel using JSON files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jason M

laravel json route router