File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 3131 'messages ' => [
3232 'table ' => 'messages ' ,
3333 /**
34- * This is the foreing key for associated to the ticket
34+ * This is the foreign key for associated to the ticket
3535 * If you renamed the ticket table, you should consider
3636 * changing this column as well to follow the laravel
3737 * convention, "table_id"
3838 *
3939 * @see https://laravel.com/docs/9.x/eloquent-relationships#one-to-many
4040 */
4141 'columns ' => [
42- 'user_foreing_id ' => 'user_id ' ,
43- 'ticket_foreing_id ' => 'ticket_id ' ,
42+ 'user_foreign_id ' => 'user_id ' ,
43+ 'ticket_foreign_id ' => 'ticket_id ' ,
4444 ],
4545 ],
4646 /**
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ return new class extends Migration
1515
1616 Schema::create($tableName['table'], function (Blueprint $table) use ($tableName) {
1717 $table->id();
18- $table->foreignId($tableName['columns']['user_foreing_id ']);
19- $table->foreignId($tableName['columns']['ticket_foreing_id ']);
18+ $table->foreignId($tableName['columns']['user_foreign_id ']);
19+ $table->foreignId($tableName['columns']['ticket_foreign_id ']);
2020 $table->text('message');
2121 $table->timestamps();
2222 });
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function ticket(): BelongsTo
3232
3333 return $ this ->belongsTo (
3434 Ticket::class,
35- $ tableName ['columns ' ]['ticket_foreing_id ' ]
35+ $ tableName ['columns ' ]['ticket_foreign_id ' ]
3636 );
3737 }
3838
@@ -45,7 +45,7 @@ public function user(): BelongsTo
4545
4646 return $ this ->belongsTo (
4747 config ('auth.providers.users.model ' ),
48- $ tableName ['columns ' ]['user_foreing_id ' ]
48+ $ tableName ['columns ' ]['user_foreign_id ' ]
4949 );
5050 }
5151
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function messages(): HasMany
6262
6363 return $ this ->hasMany (
6464 Message::class,
65- (string ) $ tableName ['columns ' ]['ticket_foreing_id ' ],
65+ (string ) $ tableName ['columns ' ]['ticket_foreign_id ' ],
6666 );
6767 }
6868
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function definition()
1717
1818 return [
1919 'user_id ' => User::factory (),
20- $ tableName ['columns ' ]['ticket_foreing_id ' ] => Ticket::factory (),
20+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => Ticket::factory (),
2121 'message ' => $ this ->faker ->paragraph (2 ),
2222 ];
2323 }
Original file line number Diff line number Diff line change 1515
1616 $ message = Message::factory ()
1717 ->create ([
18- $ tableName ['columns ' ]['ticket_foreing_id ' ] => $ ticket ->id ,
18+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => $ ticket ->id ,
1919 'message ' => 'Message from a ticket ' ,
2020 ]);
2121
2222 $ this ->assertDatabaseHas ($ tableName ['table ' ], [
23- $ tableName ['columns ' ]['ticket_foreing_id ' ] => $ ticket ->id ,
23+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => $ ticket ->id ,
2424 'message ' => 'Message from a ticket ' ,
2525 ]);
2626
You can’t perform that action at this time.
0 commit comments