Created
April 21, 2019 17:51
-
-
Save Titoratus/b505a0e5fd330c1be61a4d2d61aa543b to your computer and use it in GitHub Desktop.
Revisions
-
Titoratus created this gist
Apr 21, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ https://octobercms.com/docs/database/relations#many-to-many Таблица, которая нужна для связывания записей одной таблицы с записями другой называется сross reference table. Нужно получить значение из другой связанной таблицы? Прописываем для той модели, записи которой выводим: public $belongsToMany = [ 'phones' => ['estar\hotel\Models\Phone', 'table' => 'estar_hotel_users_phones'] ];