api & web routes

This commit is contained in:
StudioTem committed 2023-01-24 17:34:25 +01:00
1 parent 3de0b4193b
commit 30ae7dab84
2 files changed
+16 -1

No files matched your search

+14
View File
@@ -1,8 +1,11 @@
<?php
use App\Http\Resources\ProjectCollection;
use App\Http\Resources\TeamCollection;
use App\Http\Resources\TeamResource;
use App\Http\Resources\UserCollection;
use App\Http\Resources\UserResource;
use App\Models\Project;
use App\Models\Team;
use App\Models\User;
use Illuminate\Support\Facades\Route;
@@ -33,3 +36,14 @@ Route::get('/v1/teams/{id}', function ($id) {
Route::get('/v1/employees', function () {
return new UserCollection(User::all());
});
Route::get('/v1/employees/{id}', function ($id) {
return new UserResource(User::find($id));
});
Route::get('/public/v1/projects', function () {
return new ProjectCollection(Project::all());
});
+2 -1
View File
@@ -1,6 +1,7 @@
<?php
use App\Models\User;
use App\Http\Resources\TeamCollection;
use App\Models\Team;
use Illuminate\Support\Facades\Route;
/*