Mark
Mark
FFilament
Created by Firebat on 10/17/2024 in #❓┊help
Change action priority in clickable rows
I think you need to override getTableRecordUrlUsing().
12 replies
FFilament
Created by Mark on 4/25/2024 in #❓┊help
Generating slug from title example only working properly when adding debounce
So it seems it is a Livewire issue.
5 replies
FFilament
Created by Mark on 4/25/2024 in #❓┊help
Generating slug from title example only working properly when adding debounce
When I place all data in an array the problem also exists in plain Livewire:
<?php

namespace App\Livewire;

use Illuminate\Support\Str;
use Livewire\Component;

class Test extends Component
{
public array $data = ['title' => 'a', 'slug' => 'a'];

public function updatedData()
{
$this->data['slug'] = Str::slug($this->data['title']);
}

public function render()
{
return view('livewire.test');
}
}
<?php

namespace App\Livewire;

use Illuminate\Support\Str;
use Livewire\Component;

class Test extends Component
{
public array $data = ['title' => 'a', 'slug' => 'a'];

public function updatedData()
{
$this->data['slug'] = Str::slug($this->data['title']);
}

public function render()
{
return view('livewire.test');
}
}
<div>
<input type="text" wire:model.live="data.title" class="border w-full p-1">
{{ $data['slug'] }}
</div>
<div>
<input type="text" wire:model.live="data.title" class="border w-full p-1">
{{ $data['slug'] }}
</div>
5 replies
FFilament
Created by Mark on 4/25/2024 in #❓┊help
Generating slug from title example only working properly when adding debounce
This seems related with: https://discord.com/channels/883083792112300104/1207372102693290024 But when I create a new Livewire component doing something like this all is fine:
<?php

namespace App\Livewire;

use Illuminate\Support\Str;
use Livewire\Component;

class Test extends Component
{
public string $title = 'a';
public string $slug = 'a';

public function updatedTitle()
{
$this->slug = Str::slug($this->title);
}

public function render()
{
return view('livewire.test');
}
}
<?php

namespace App\Livewire;

use Illuminate\Support\Str;
use Livewire\Component;

class Test extends Component
{
public string $title = 'a';
public string $slug = 'a';

public function updatedTitle()
{
$this->slug = Str::slug($this->title);
}

public function render()
{
return view('livewire.test');
}
}
<div>
<input type="text" wire:model.live="title" class="border w-full p-1">
{{ $slug }}
</div>
<div>
<input type="text" wire:model.live="title" class="border w-full p-1">
{{ $slug }}
</div>
No missed keystrokes and the slug is updating as it should.
5 replies