Laravel.io
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::namespace('Api')->group(function()
{
//Rota dos clientes internos até usuários
Route::apiResource('internal-clients', 'InternalClientController', ['except' => ['create','edit']]);
Route::apiResource('subsidiaries', 'SubsidiaryController', ['except' => ['create','edit']]);
Route::apiResource('departments', 'DepartmentController', ['except' => ['create','edit']]);
Route::apiResource('sections', 'SectionController', ['except' => ['create','edit']]);
Route::apiResource('job-titles', 'JobTitleController', ['except' => ['create','edit']]);
Route::apiResource('users', 'UserController', ['except' => ['create','edit']]);
//Rota das Tarefas
Route::apiResource('recurrences', 'RecurrenceController', ['except' => ['create','edit']]); //Colocar como GET
Route::apiResource('status', 'StatusController', ['except' => ['create','edit']]);
Route::apiResource('task-types', 'TaskTypeController', ['except' => ['create','edit']]);
Route::apiResource('task-lists', 'TaskListController', ['except' => ['create','edit']]);
});