数据表和路由设计应该要有层级吗?
数据库设计 比如我的收藏和我的关注数据表
应该直接用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');
数据库主要还是看主体是谁,如果是单一主体,比如就是users表的收藏,可以叫users_follows ,如果是多态关联,可以叫follows 当然,单一应用项目也可以使用follows