25 lines
927 B
PHP
25 lines
927 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::group(['prefix' => 'user', 'middleware' => ['assign.guard:users']], function () {
|
|
Route::post('/register', 'UsersController@register');
|
|
Route::post('/login', 'UsersController@login');
|
|
Route::get('/me', 'UsersController@me');
|
|
Route::post('/save-recipe', 'UsersController@saveRecipe')->middleware(['jwt.auth']);
|
|
Route::get('/history', 'UsersController@getRecipeHistory')->middleware(['jwt.auth']);
|
|
});
|
|
|
|
Route::prefix('product')->group(function () {
|
|
Route::post('/', 'ProductsController@add')->middleware(['jwt.auth']);
|
|
Route::get('/', 'ProductsController@index');
|
|
});
|
|
|
|
Route::prefix('recipe')->group(function () {
|
|
Route::post('/', 'RecipesController@add')->middleware(['jwt.auth']);
|
|
Route::get('/', 'RecipesController@index');
|
|
Route::get('/{id}', 'RecipesController@get');
|
|
});
|
|
|
|
Route::post('calculate', 'ProductsController@calculate');
|