43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Helpers\Slack;
|
|
use App\Models\Log;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Rule;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('layouts.app')] class extends Component
|
|
{
|
|
#[Rule(['required', 'string'])]
|
|
public string $quote = '';
|
|
|
|
public function sendQuote(): void
|
|
{
|
|
$validated = $this->validate();
|
|
|
|
$slack = new Slack();
|
|
|
|
$slack->sendText($validated['quote']);
|
|
|
|
$this->quote = '';
|
|
}
|
|
}; ?>
|
|
|
|
<div class="px-4 sm:px-6 lg:px-8">
|
|
<form wire:submit="sendQuote">
|
|
<x-text-input
|
|
wire:model="quote"
|
|
placeholder="{{ __('What did he say this time?') }}"
|
|
class="block w-full text-nexi-black border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm"
|
|
></x-text-input>
|
|
|
|
<x-input-error :messages="$errors->get('quote')" class="mt-2"/>
|
|
<x-primary-button wire:loading.attr="disabled"
|
|
wire:loading.class="opacity-50"
|
|
class="mt-4">
|
|
{{ __('Send') }}
|
|
</x-primary-button>
|
|
</form>
|
|
</div>
|