Answer the question
In order to leave comments, you need to log in
How to make filling with migrations in a many-to-many relationship?
There are three tables Autor, Book and BookAutor. The Autor table is populated like this
$this->insert(Autor::tableName(), [
'first_name' => 'Рей',
'second_name' => 'Бредбери',
]);
$this->insert(Book::tableName(), [
'title' => '451 градус по Фаренгейту',
]);
Answer the question
In order to leave comments, you need to log in
and what prevents in migrations to create instances of Author and Book?
if it is not imported by the millions, of course.
but in general, it seems that you need imports, not migrations ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question