Skip to content

Commit

Permalink
Merge pull request #11 from socialblue/develop
Browse files Browse the repository at this point in the history
use controller to output route data insteadof closure
  • Loading branch information
mbroersen committed May 27, 2019
2 parents 0312592 + c5b086f commit 24648a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
11 changes: 3 additions & 8 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?php
use Illuminate\Support\Facades\Route;

use Illuminate\Support\Facades\Cache;


Route::get('/', view('laravel-query-adviser::index'));


Route::get('/query/list', function () {
return Cache::get(config('laravel-query-adviser.cache.key'), []);
Route::prefix('api')->group(function () {
Route::get('/query/get', 'QueryController@get');
});
13 changes: 13 additions & 0 deletions src/Http/Controllers/QueryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Socialblue\LaravelQueryAdviser\Http\Controllers;

use Illuminate\Http\Request;

class QueryController extends Controller
{
public function get(Request $request)
{
return Cache::get(config('laravel-query-adviser.cache.key'), []);
}
}

0 comments on commit 24648a9

Please sign in to comment.