File tree 6 files changed +11
-11
lines changed
6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 31
31
'messages ' => [
32
32
'table ' => 'messages ' ,
33
33
/**
34
- * This is the foreing key for associated to the ticket
34
+ * This is the foreign key for associated to the ticket
35
35
* If you renamed the ticket table, you should consider
36
36
* changing this column as well to follow the laravel
37
37
* convention, "table_id"
38
38
*
39
39
* @see https://laravel.com/docs/9.x/eloquent-relationships#one-to-many
40
40
*/
41
41
'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 ' ,
44
44
],
45
45
],
46
46
/**
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ return new class extends Migration
15
15
16
16
Schema::create($tableName['table'], function (Blueprint $table) use ($tableName) {
17
17
$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 ']);
20
20
$table->text('message');
21
21
$table->timestamps();
22
22
});
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function ticket(): BelongsTo
32
32
33
33
return $ this ->belongsTo (
34
34
Ticket::class,
35
- $ tableName ['columns ' ]['ticket_foreing_id ' ]
35
+ $ tableName ['columns ' ]['ticket_foreign_id ' ]
36
36
);
37
37
}
38
38
@@ -45,7 +45,7 @@ public function user(): BelongsTo
45
45
46
46
return $ this ->belongsTo (
47
47
config ('auth.providers.users.model ' ),
48
- $ tableName ['columns ' ]['user_foreing_id ' ]
48
+ $ tableName ['columns ' ]['user_foreign_id ' ]
49
49
);
50
50
}
51
51
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function messages(): HasMany
62
62
63
63
return $ this ->hasMany (
64
64
Message::class,
65
- (string ) $ tableName ['columns ' ]['ticket_foreing_id ' ],
65
+ (string ) $ tableName ['columns ' ]['ticket_foreign_id ' ],
66
66
);
67
67
}
68
68
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function definition()
17
17
18
18
return [
19
19
'user_id ' => User::factory (),
20
- $ tableName ['columns ' ]['ticket_foreing_id ' ] => Ticket::factory (),
20
+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => Ticket::factory (),
21
21
'message ' => $ this ->faker ->paragraph (2 ),
22
22
];
23
23
}
Original file line number Diff line number Diff line change 15
15
16
16
$ message = Message::factory ()
17
17
->create ([
18
- $ tableName ['columns ' ]['ticket_foreing_id ' ] => $ ticket ->id ,
18
+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => $ ticket ->id ,
19
19
'message ' => 'Message from a ticket ' ,
20
20
]);
21
21
22
22
$ this ->assertDatabaseHas ($ tableName ['table ' ], [
23
- $ tableName ['columns ' ]['ticket_foreing_id ' ] => $ ticket ->id ,
23
+ $ tableName ['columns ' ]['ticket_foreign_id ' ] => $ ticket ->id ,
24
24
'message ' => 'Message from a ticket ' ,
25
25
]);
26
26
You can’t perform that action at this time.
0 commit comments