Route::get('/', function () {
return View::make('front.index');
});
//Admin routes
Route::group(array('prefix' => 'admin', 'namespace' => 'App\\Http\\Admin\\Controllers'), function () {
Route::get('/', array('uses' => 'AdminController@index'));
});
Route::get('/generator', array('uses' => 'GeneratorController@index'));
Route::get('/createtoken', function () {
$customer = Customer::whereEmail('*****@*****.**')->first();
$token = JWTAuth::fromUser($customer);
return Response::json($token);
});
Route::get('/testtoken', function () {
$headers1 = Request::header("custom");
JWTAuth::setRequest(Request::instance());
$headers2 = JWTAuth::getRequest()->header();
$token = JWTAuth::getToken();
return Response::json(JWTAuth::toUser($token));
});
Route::get('/testpost', function () {
$param = \Illuminate\Support\Facades\Input::all();
$name = $param->name;
return \Symfony\Component\HttpFoundation\Response::json($param);
});
//Front routes
Route::group(array('prefix' => 'api'), function () {
// customers
Route::post('customers/login', array('uses' => 'CustomerController@login'));
Route::post('customers/logout', array('uses' => 'CustomerController@logout'));
Route::post('customers/register', array('uses' => 'CustomerController@register'));