Skip to content

Commit

Permalink
- wip
Browse files Browse the repository at this point in the history
  • Loading branch information
EwelinaSkrzypacz committed Oct 16, 2024
1 parent c45b324 commit 16e7a05
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Requests/StoreRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function data(): array
"email" => $this->get("email"),
"topic" => $this->get("topic"),
"message" => $this->get("message"),
"lang" => app()->getLocale(),
];
}
}
2 changes: 2 additions & 0 deletions app/Models/ContactForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @property string $email
* @property string $topic
* @property string $message
* @property string $lang
* @property ContactFormStatus $status
*/
class ContactForm extends Model
Expand All @@ -24,6 +25,7 @@ class ContactForm extends Model
"message",
"status",
"response",
"lang",
];
protected $casts = [
"status" => ContactFormStatus::class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration {
public function up(): void
{
Schema::table("contact_forms", function (Blueprint $table): void {
$table->string("lang")->default("pl");
});
}

public function down(): void
{
Schema::table("contact_forms", function (Blueprint $table): void {
$table->dropColumn("lang");
});
}
};

0 comments on commit 16e7a05

Please sign in to comment.