Add optional Tone field to Sites for AI content generation

- Add tone column to sites table (nullable string)
- Add TONES constant to Site model with predefined options:
  professional, casual, technical, friendly, formal, humorous,
  conversational, authoritative, inspirational, educational, minimal, detailed
- Update Sites Livewire component to edit tone
- Update Sites view with tone select dropdown in form
- Add tone column to sites table display
- Add tone to SiteResource API response

AI agents can now read the site's tone and use it when generating content.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
m105
2026-07-28 22:06:17 +03:00
parent cee9fdc290
commit efdec9eabd
5 changed files with 59 additions and 0 deletions
@@ -11,6 +11,7 @@
<th class="p-3">URL</th>
<th class="p-3">Description</th>
<th class="p-3">CMS Type</th>
<th class="p-3">Tone</th>
<th class="p-3"></th>
</tr>
</thead>
@@ -38,6 +39,13 @@
<div class="text-xs text-gray-500" title="{{ $site->api_instructions }}">Has API instructions</div>
@endif
</td>
<td class="p-3">
@if ($site->tone)
<span class="text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded">{{ $site->tone }}</span>
@else
<span class="text-gray-400">—</span>
@endif
</td>
<td class="p-3 text-right space-x-2">
<button wire:click="edit({{ $site->id }})" class="text-blue-600">Edit</button>
<button wire:click="delete({{ $site->id }})" wire:confirm="Delete this site?" class="text-red-600">Delete</button>
@@ -69,6 +77,20 @@
<textarea wire:model="description" class="w-full border rounded p-2"></textarea>
</div>
<div>
<label class="block text-sm font-medium">Tone (optional for AI)</label>
<select wire:model="tone" class="w-full border rounded p-2">
<option value="">No tone specified</option>
@foreach ($tones as $t)
<option value="{{ $t }}">{{ ucfirst($t) }}</option>
@endforeach
</select>
<p class="text-xs text-gray-500 mt-1">
Writing style for AI-generated content (e.g., professional, casual, technical).
</p>
@error('tone') <span class="text-red-600 text-sm">{{ $message }}</span> @enderror
</div>
<div>
<label class="block text-sm font-medium">CMS Type</label>
<select wire:model.live="cmsType" class="w-full border rounded p-2">