Asmit Nepali
Asmit Nepali
FFilament
Created by Asmit Nepali on 10/24/2024 in #❓┊help
Share form problem.
I think the solution provided by @toeknee is works for me Thank you, Please suggest me if there any other effect solution
8 replies
FFilament
Created by Asmit Nepali on 10/24/2024 in #❓┊help
Share form problem.
@Kane G Thank you for your reply, but still I have an issue.
8 replies
FFilament
Created by Asmit Nepali on 10/24/2024 in #❓┊help
Share form problem.
@toeknee Thank you for reply Could please give some reference how to render conditionally.
8 replies
FFilament
Created by Nuxnux on 10/8/2024 in #❓┊help
Notification not being send by reverb`
Any solutions
4 replies
FFilament
Created by Asmit Nepali on 10/19/2024 in #❓┊help
Custom field dynamic query
Anyone have any idea💡
7 replies
FFilament
Created by Asmit Nepali on 10/19/2024 in #❓┊help
Custom field dynamic query
This is my livewire blade file
<div>
<div
contenteditable="true"
id="editableDiv"
@input="state = $event.target.innerHTML"
@blur="$dispatch('input', $event.target.innerHTML)"
wire:ignore
>
</div>
<input id="hidden-text-box" type="hidden" x-model="state" />

@if($showUserList)
<ul class="bg-white border mt-2 max-h-32 overflow-auto">
//triggerVariable
</ul>
@endif
</div>

@script
<script>
console.log('Livewire component initialized');
let editableDiv = document.getElementById('editableDiv');
let typingTimer; // Timer identifier
const debounceInterval = 300;
editableDiv.addEventListener('input', function () {
console.log('input event triggered');
let content = editableDiv.innerHTML;
let cursorPosition = window.getSelection().focusOffset;
clearTimeout(typingTimer);
let lastAtIndex = content.lastIndexOf('[');
if (lastAtIndex !== -1 && cursorPosition > lastAtIndex + 1) {
let searchTerm = content.substring(lastAtIndex + 1, cursorPosition).trim();
if (searchTerm.length > 0 && !/\s/.test(searchTerm)) {
typingTimer = setTimeout(() => {
$wire.searchVariables(searchTerm);
}, debounceInterval);
}
}
});
Livewire.on('triggerVariable', variable => {
// statements
);
</script>
@endscript
<div>
<div
contenteditable="true"
id="editableDiv"
@input="state = $event.target.innerHTML"
@blur="$dispatch('input', $event.target.innerHTML)"
wire:ignore
>
</div>
<input id="hidden-text-box" type="hidden" x-model="state" />

@if($showUserList)
<ul class="bg-white border mt-2 max-h-32 overflow-auto">
//triggerVariable
</ul>
@endif
</div>

@script
<script>
console.log('Livewire component initialized');
let editableDiv = document.getElementById('editableDiv');
let typingTimer; // Timer identifier
const debounceInterval = 300;
editableDiv.addEventListener('input', function () {
console.log('input event triggered');
let content = editableDiv.innerHTML;
let cursorPosition = window.getSelection().focusOffset;
clearTimeout(typingTimer);
let lastAtIndex = content.lastIndexOf('[');
if (lastAtIndex !== -1 && cursorPosition > lastAtIndex + 1) {
let searchTerm = content.substring(lastAtIndex + 1, cursorPosition).trim();
if (searchTerm.length > 0 && !/\s/.test(searchTerm)) {
typingTimer = setTimeout(() => {
$wire.searchVariables(searchTerm);
}, debounceInterval);
}
}
});
Livewire.on('triggerVariable', variable => {
// statements
);
</script>
@endscript
I want to call searchVariables on change the input field ISSUE: 1. From blade file unable to pass query on livewire class. 2. If I not use livewire then how to call searchVaribales method of blade class from custom field blade file. Note: What I try to do is, Create custom field where I have to add dynamic variables.
7 replies
FFilament
Created by Asmit Nepali on 10/19/2024 in #❓┊help
Custom field dynamic query
This is my custom field blade file. I want to pass query builder to livewire. But livewire says prototype issue.
<?php
class LiveMention extends Component
{
public Builder $query;
public $variables = [];
public $showVariables = false;
public function mount($query) {
$this->query = $query;
}
public function searchVariables(string $value)
{
$searchString = Str::remove('[', $value);
$this->showVariables = strlen($value) > 0;
$this->variables = $this->query
->where('title', 'like','%'.$searchString.'%')
->get()->map(function($variable) {
return [
'id' => $variable->id,
'title' => $variable->title,
];
});
}

public function triggerVariable($variableName)
{
// Emit the selected variable back to JavaScript
$this->dispatch('triggerVariable', ['title' => $variableName]);
}

public function render()
{
return view('livewire.live-varibale');
}
}
<?php
class LiveMention extends Component
{
public Builder $query;
public $variables = [];
public $showVariables = false;
public function mount($query) {
$this->query = $query;
}
public function searchVariables(string $value)
{
$searchString = Str::remove('[', $value);
$this->showVariables = strlen($value) > 0;
$this->variables = $this->query
->where('title', 'like','%'.$searchString.'%')
->get()->map(function($variable) {
return [
'id' => $variable->id,
'title' => $variable->title,
];
});
}

public function triggerVariable($variableName)
{
// Emit the selected variable back to JavaScript
$this->dispatch('triggerVariable', ['title' => $variableName]);
}

public function render()
{
return view('livewire.live-varibale');
}
}
7 replies
FFilament
Created by Asmit Nepali on 10/19/2024 in #❓┊help
Custom field dynamic query
@Lara Zeus Thank you for replying. In livewire version.
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div x-data="{ state: $wire.$entangle('{{ $getStatePath() }}') }">
<livewire:live-varibale x-model="state" :field="$field->getModifyingQuery()"/>
<input x-model="state">
</div>
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div x-data="{ state: $wire.$entangle('{{ $getStatePath() }}') }">
<livewire:live-varibale x-model="state" :field="$field->getModifyingQuery()"/>
<input x-model="state">
</div>
7 replies
FFilament
Created by Asmit Nepali on 10/17/2024 in #❓┊help
Custom Field Send Multiple Data
Is there any way to do this ?
8 replies
FFilament
Created by Asmit Nepali on 10/17/2024 in #❓┊help
Custom Field Send Multiple Data
Basically while I try to submit the filament form the form data should look like this
[ 'bio' => 'hello bio', 'bio_with_style' => 'some style and bio' ]
[ 'bio' => 'hello bio', 'bio_with_style' => 'some style and bio' ]
My custom field should add these data on form data
8 replies
FFilament
Created by Asmit Nepali on 10/17/2024 in #❓┊help
Custom Field Send Multiple Data
Actually I want to add extra form data with
bio_with_style
bio_with_style
which contain original field state with some extra customization
8 replies
FFilament
Created by Asmit Nepali on 10/15/2024 in #❓┊help
File Upload Issue
Thank you @Alexandre It works !. I add client_max_body 100M; on nginx config file inside server block.
9 replies
FFilament
Created by Asmit Nepali on 10/15/2024 in #❓┊help
File Upload Issue
console error
livewire.js?id=cc800bf4:612
POST http://exmple.test/livewire/upload-file?expires=1728985122&signature=59de44a856da3dc4086d52113ff8bab740b885363c943576cbd9853e0eb1022c 413 (Request Entity Too Large)
livewire.js?id=cc800bf4:612
POST http://exmple.test/livewire/upload-file?expires=1728985122&signature=59de44a856da3dc4086d52113ff8bab740b885363c943576cbd9853e0eb1022c 413 (Request Entity Too Large)
9 replies
FFilament
Created by Asmit Nepali on 10/15/2024 in #❓┊help
File Upload Issue
@Alexandre Thank you for reply max_file_uploads => 20 => 20 upload_max_filesize => 3M => 3M opcache.max_file_size => 0 => 0 My configuration
9 replies
FFilament
Created by Asmit Nepali on 10/2/2024 in #❓┊help
Filament notification delete issue.
Any Idea 💡 please
3 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
@Leandro Ferreira https://discord.com/channels/883083792112300104/1247909942317547601/1250347583277105242 This work for now but I tried in a different way This is my table column
SelectColumn::make('subject')
->options(SubjectClass::class)
->updateStateUsing(function (Page $livewire, $record) {
return $livewire->mountAction('updateSubject');
})
->sortable(),
SelectColumn::make('subject')
->options(SubjectClass::class)
->updateStateUsing(function (Page $livewire, $record) {
return $livewire->mountAction('updateSubject');
})
->sortable(),
This is my ListSubject page method
public function updateSubject()
{
return Actions\Action::make('updateSubject')
->action(fn () => dd('test'));
}
public function updateSubject()
{
return Actions\Action::make('updateSubject')
->action(fn () => dd('test'));
}
the dd test is work here but If I try to add ->requiresConfirmation() then it not work is there any way to use like this
11 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
Thank you @Leandro Ferreira
11 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
Hello
11 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
Thank you @Tonkawuck , But I have to update subject from table
11 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
Could you please provide example of that, what you are trying to say, It would be very helpful.
11 replies