diff --git a/app/Http/Requests/StoreRequest.php b/app/Http/Requests/StoreRequest.php index c9943b49..f1f24def 100644 --- a/app/Http/Requests/StoreRequest.php +++ b/app/Http/Requests/StoreRequest.php @@ -26,6 +26,7 @@ public function data(): array "email" => $this->get("email"), "topic" => $this->get("topic"), "message" => $this->get("message"), + "lang" => app()->getLocale(), ]; } } diff --git a/app/Models/ContactForm.php b/app/Models/ContactForm.php index 89bf1af6..c2071ede 100644 --- a/app/Models/ContactForm.php +++ b/app/Models/ContactForm.php @@ -12,6 +12,7 @@ * @property string $email * @property string $topic * @property string $message + * @property string $lang * @property ContactFormStatus $status */ class ContactForm extends Model @@ -24,6 +25,7 @@ class ContactForm extends Model "message", "status", "response", + "lang", ]; protected $casts = [ "status" => ContactFormStatus::class, diff --git a/database/migrations/2024_10_16_083511_add_lang_column_in_contact_forms_table.php b/database/migrations/2024_10_16_083511_add_lang_column_in_contact_forms_table.php new file mode 100644 index 00000000..c1d655f3 --- /dev/null +++ b/database/migrations/2024_10_16_083511_add_lang_column_in_contact_forms_table.php @@ -0,0 +1,23 @@ +string("lang")->default("pl"); + }); + } + + public function down(): void + { + Schema::table("contact_forms", function (Blueprint $table): void { + $table->dropColumn("lang"); + }); + } +};