数据表和路由设计应该要有层级吗?

数据库设计 比如我的收藏和我的关注数据表

应该直接用 pe_follows 和 pe_collections
还是需要设计成 pe_user_follows 和 pe_user_collections
有没有什么标准或者常用的规范喃?

数据表和路由设计应该要有层级吗?

比如路由 我的收藏列表 应该直接用 /collections 还是应该 user/collections


 //我的收藏
Route::match(['post', 'get'], 'collections',[UserController::class, 'collections'])->name('collections');
 //我的收藏
Route::match(['post', 'get'], 'collections',[UserController::class, 'user/collections'])->name('user.collections');
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 1

数据库主要还是看主体是谁,如果是单一主体,比如就是 users 表的收藏,可以叫 users_follows ,如果是多态关联,可以叫 follows 当然,单一应用项目也可以使用 follows

2年前 评论