mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
API blueprint test
This commit is contained in:
1 parent
daf4850506
commit
c4e3282be8
5 files changed
+102
-6
No files matched your search
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('api');
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
return json_decode('{
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Team 111",
|
||||
"employees": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Rastislav",
|
||||
"surname": "Kuttner"
|
||||
},
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Lenka",
|
||||
"surname": "Nemeckova"
|
||||
},
|
||||
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Peter",
|
||||
"surname": "Bucan"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Team 2",
|
||||
"employees": [
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Peter",
|
||||
"surname": "Bucan"
|
||||
},
|
||||
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Pavel",
|
||||
"surname": "Gajdos"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Team 3",
|
||||
"employees": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Rastislav",
|
||||
"surname": "Kuttner"
|
||||
},
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Lenka",
|
||||
"surname": "Nemeckova"
|
||||
},
|
||||
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Peter",
|
||||
"surname": "Bucan"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": 200
|
||||
}');
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user