erp/routes/api.php

37 lines
1.7 KiB
PHP
Raw Normal View History

2022-07-23 17:07:13 +08:00
<?php
2022-07-27 19:06:16 +08:00
use App\Http\Controllers\Auth\LoginController;
2022-07-23 17:07:13 +08:00
/*
|--------------------------------------------------------------------------
| 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!
|
*/
2022-07-27 19:06:16 +08:00
Route::middleware('auth:api')->group(function () {
// 用户
2022-07-28 13:46:08 +08:00
Route::resource('users', 'User\UsersController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-27 19:06:16 +08:00
// 商品种类
2022-07-28 13:46:08 +08:00
Route::resource('goods_types', 'Goods\GoodsTypesController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-27 19:06:16 +08:00
// 商品品牌
2022-07-28 13:46:08 +08:00
Route::resource('goods_brands', 'Goods\GoodsBrandsController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-27 19:06:16 +08:00
// 日志
Route::resource('logs', 'Log\LogsController', ['only' => ['index', 'show']]);
// 商品
2022-07-28 13:46:08 +08:00
Route::resource('goods', 'Goods\GoodsController', ['only' => ['index', 'store']]);
// 商品规格
Route::resource('goods_skus', 'Goods\GoodsSkusController', ['only' => ['index', 'show', 'update']]);
2022-07-27 19:06:16 +08:00
// 店铺
2022-07-28 13:46:08 +08:00
Route::resource('shops', 'Log\LogsController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-27 19:06:16 +08:00
// 角色
2022-07-28 13:46:08 +08:00
Route::resource('roles', 'Role\RolesController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-27 19:06:16 +08:00
// 权限
2022-07-28 13:46:08 +08:00
Route::resource('permissions', 'Permissions\LogsController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]);
2022-07-23 17:07:13 +08:00
});
2022-07-27 19:06:16 +08:00
Route::post('/auth/login', [LoginController::class, 'login'])->name('auth.login');