Created
December 6, 2013 16:04
-
-
Save atrauzzi/7827217 to your computer and use it in GitHub Desktop.
Static route helpers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace My\Namespace; | |
use Illuminate\Support\Facades\Route; | |
class Routes { | |
public static function all() { | |
static::allDevice(); | |
static::allPlatform(); | |
} | |
public static function allDevice($prefix = 'device') { | |
Route::group(['prefix' => $prefix], function () { | |
static::deviceStore(); | |
static::deviceUpdate(); | |
static::deviceShow(); | |
}); | |
} | |
public static function deviceStore() { | |
Route::post('', 'My\Namespace\Controller\Device@store'); | |
} | |
public static function deviceUpdate() { | |
Route::post('{id}', 'My\Namespace\Controller\Device@update'); | |
} | |
public static function deviceShow() { | |
Route::get('{id}', 'My\Namespace\Controller\Device@show'); | |
} | |
public static function allPlatform($prefix = 'platform') { | |
Route::group(['prefix' => $prefix], function () { | |
static::platformIndex(); | |
static::platformShow(); | |
}); | |
} | |
public static function platformIndex() { | |
Route::get('', 'My\Namespace\Controller\Platform@index'); | |
} | |
public static function platformShow() { | |
Route::get('{id}', 'My\Namespace\Controller\Platform@show'); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment