Skip to content

Instantly share code, notes, and snippets.

@matheusdavidson
Created November 15, 2014 03:23
Show Gist options
  • Save matheusdavidson/d003cf9cc067e2b1575a to your computer and use it in GitHub Desktop.
Save matheusdavidson/d003cf9cc067e2b1575a to your computer and use it in GitHub Desktop.
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
/*
API V1 ESBOX
*/
Route::group(array(
'prefix' => 'v1',
'before' => 'auth.v1.token',
), function () {
Route::get('/', function () {
die('hello');
$user = Sentry::getUser();
$token = $user->tokens()->where('client', BrowserDetect::toString())->first();
return Response::json(array(
'user' => $user->toArray(),
'token' => $token->toArray()
));
});
Route::get('logout', array(
'as' => 'v1.logout',
'uses' => 'App\Controllers\AuthApiV1Controller@getLogout',
));
Route::get('customers/contacts/search', array(
'as' => 'v1.customers.contacts.search',
'uses' => 'EsboxCustomerController@contacts',
));
Route::get('customers/search', array(
'as' => 'v1.customers.search',
'uses' => 'EsboxCustomerController@search',
));
Route::post('quotes/upload/{type}', array(
'as' => 'v1.quotes.upload',
'uses' => 'EsboxQuoteController@upload',
));
Route::resource('quotes', 'EsboxQuoteController');
Route::resource('customers', 'EsboxCustomerController');
});
/*
ESBOX CLASSIC FRONT
*/
/*Route::get('admin/logout', array(
'as' => 'admin.logout',
'uses' => 'App\Controllers\AuthController@getLogout'
));
Route::get('admin/login', array(
'as' => 'admin.login',
'uses' => 'App\Controllers\AuthController@getLogin'
));
Route::post('admin/login', array(
'as' => 'admin.login.post',
'uses' => 'App\Controllers\AuthController@postLogin'
));
Route::group(array(
'prefix' => 'admin',
'before' => 'auth.admin'
) , function () {
Route::get('customers/contacts/search', array(
'as' => 'admin.customers.contacts.search',
'uses' => 'EsboxCustomerController@contacts'
));
Route::get('customers/search', array(
'as' => 'admin.customers.search',
'uses' => 'EsboxCustomerController@search'
));
Route::post('quotes/upload/{type}', array(
'as' => 'admin.quotes.upload',
'uses' => 'EsboxQuoteController@upload'
));
Route::resource('quotes', 'EsboxQuoteController');
Route::resource('customers', 'EsboxCustomerController');
Route::any('/', 'App\Controllers\EsboxController@index');
});
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment