diff --git a/app/Http/Resources/SiteResource.php b/app/Http/Resources/SiteResource.php index cce5877..464c3a6 100644 --- a/app/Http/Resources/SiteResource.php +++ b/app/Http/Resources/SiteResource.php @@ -18,6 +18,7 @@ class SiteResource extends JsonResource 'wp_username' => $this->wp_username, 'wp_app_password' => $this->wp_app_password, 'api_instructions' => $this->api_instructions, + 'tone' => $this->tone, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; diff --git a/app/Livewire/Sites/Index.php b/app/Livewire/Sites/Index.php index 80dcaf5..b3ec533 100644 --- a/app/Livewire/Sites/Index.php +++ b/app/Livewire/Sites/Index.php @@ -29,11 +29,14 @@ class Index extends Component public ?string $apiInstructions = null; + public ?string $tone = null; + public function render() { return view('livewire.sites.index', [ 'sites' => Site::orderBy('name')->get(), 'cmsTypes' => Site::CMS_TYPES, + 'tones' => Site::TONES, ]); } @@ -54,6 +57,7 @@ class Index extends Component $this->wpUsername = $site->wp_username ?? ''; $this->wpAppPassword = $site->wp_app_password ?? ''; $this->apiInstructions = $site->api_instructions; + $this->tone = $site->tone; $this->showForm = true; } @@ -67,6 +71,7 @@ class Index extends Component 'wpUsername' => ['required_if:cmsType,wordpress', 'nullable', 'string', 'max:255'], 'wpAppPassword' => ['required_if:cmsType,wordpress', 'nullable', 'string', 'max:255'], 'apiInstructions' => ['nullable', 'string'], + 'tone' => ['nullable', 'string'], ]); Site::updateOrCreate(['id' => $this->editingId], [ @@ -77,6 +82,7 @@ class Index extends Component 'wp_username' => $validated['cmsType'] === 'wordpress' ? $validated['wpUsername'] : null, 'wp_app_password' => $validated['cmsType'] === 'wordpress' ? $validated['wpAppPassword'] : null, 'api_instructions' => $validated['apiInstructions'], + 'tone' => $validated['tone'], ]); $this->resetForm(); @@ -103,6 +109,7 @@ class Index extends Component $this->wpUsername = ''; $this->wpAppPassword = ''; $this->apiInstructions = null; + $this->tone = null; $this->resetValidation(); } } diff --git a/app/Models/Site.php b/app/Models/Site.php index a852374..574661c 100644 --- a/app/Models/Site.php +++ b/app/Models/Site.php @@ -11,6 +11,12 @@ class Site extends Model public const CMS_TYPES = ['wordpress', 'custom', 'other']; + public const TONES = [ + 'professional', 'casual', 'technical', 'friendly', + 'formal', 'humorous', 'conversational', 'authoritative', + 'inspirational', 'educational', 'minimal', 'detailed', + ]; + protected $fillable = [ 'name', 'url', @@ -19,5 +25,6 @@ class Site extends Model 'wp_username', 'wp_app_password', 'api_instructions', + 'tone', ]; } diff --git a/database/migrations/2026_07_27_000005_add_tone_to_sites_table.php b/database/migrations/2026_07_27_000005_add_tone_to_sites_table.php new file mode 100644 index 0000000..0e93293 --- /dev/null +++ b/database/migrations/2026_07_27_000005_add_tone_to_sites_table.php @@ -0,0 +1,22 @@ +string('tone')->nullable()->after('api_instructions'); + }); + } + + public function down(): void + { + Schema::table('sites', function (Blueprint $table) { + $table->dropColumn('tone'); + }); + } +}; diff --git a/resources/views/livewire/sites/index.blade.php b/resources/views/livewire/sites/index.blade.php index 3d07897..0ab9a81 100644 --- a/resources/views/livewire/sites/index.blade.php +++ b/resources/views/livewire/sites/index.blade.php @@ -11,6 +11,7 @@ URL Description CMS Type + Tone @@ -38,6 +39,13 @@
Has API instructions
@endif + + @if ($site->tone) + {{ $site->tone }} + @else + — + @endif + @@ -69,6 +77,20 @@ +
+ + +

+ Writing style for AI-generated content (e.g., professional, casual, technical). +

+ @error('tone') {{ $message }} @enderror +
+