Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | protected function createPivot(string $table, string $first_table, string $second_table, string $first_key, string $second_key) |
||
23 | { |
||
24 | $this->create($table, function (Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) { |
||
25 | $table->unsignedBigInteger($first_key)->index(); |
||
26 | $table->unsignedBigInteger($second_key); |
||
27 | |||
28 | $table->foreign($first_key)->references('id')->on($first_table)->onDelete('cascade'); |
||
29 | $table->foreign($second_key)->references('id')->on($second_table)->onDelete('cascade'); |
||
30 | }); |
||
33 |