employees endpoint

This commit is contained in:
StudioTem committed 2023-01-17 12:21:26 +01:00
1 parent 876a67604d
commit 8b64d31962
4 files changed
+15 -2

No files matched your search

+11
View File
@@ -1,7 +1,10 @@
<?php
use App\Http\Resources\TeamCollection;
use App\Http\Resources\TeamResource;
use App\Http\Resources\UserCollection;
use App\Models\Team;
use App\Models\User;
use Illuminate\Support\Facades\Route;
/*
@@ -22,3 +25,11 @@ use Illuminate\Support\Facades\Route;
Route::get('/v1/teams', function () {
return new TeamCollection(Team::all());
});
Route::get('/v1/teams/{id}', function ($id) {
return new TeamResource(Team::find($id));
});
Route::get('/v1/employees', function () {
return new UserCollection(User::all());
});