Skip to content
Permalink
Browse files

Controller

  • Loading branch information...
diego-betalabs committed Sep 14, 2018
1 parent c57d350 commit 578fb6aa293c882d4dbaad599b95d8db1845138f
Showing with 25 additions and 0 deletions.
  1. +23 −0 app/Http/Controllers/FooController.php
  2. +2 −0 routes/api.php
@@ -0,0 +1,23 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Engine;
class FooController extends Controller
{
public function index(\Betalabs\Engine\Requests\Request $engineRequest)
{
// First we need to add the Tenant in the scope. By default it is not
// automatic but you can include it in a middleware, for example. Also
// since we are using auth:api so an user is surely logged.
Engine::auth(\Auth::user());
$response = $engineRequest->get('engine-endpoint')->getContents();
//...
return response()->setStatusCode(204);
}
}
@@ -16,3 +16,5 @@
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::middleware('auth:api')->get('/foo', 'FooController@index');

0 comments on commit 578fb6a

Please sign in to comment.
You can’t perform that action at this time.