我有3個表 用戶: id
name
偏愛: id:
title:
使用UserPreferences: user_id
preference_id
如何爲保存數據創建視圖模型並創建這樣的表單? New User
Name
|------------|
|textbox |
|------------|
Your Preferences
[
我有一個多對多的關係Laravel很多用戶有很多角色 我知道,我能做的用戶::發現(1) - >角色() - >得到( )爲用戶獲得ID爲1的所有角色,但這需要我知道該角色的ID與其名稱相反 我可以在我的用戶存儲庫中放入什麼樣的雄辯查詢來執行類似 public function getAllUsersWithRole($roleType){
//Query goes here
}