Majid Al Zariey
Majid Al Zariey
FFilament
Created by Jessy on 4/17/2024 in #❓┊help
wizard - hidden last step based on a radio option and save
You will have to override the view of course
6 replies
FFilament
Created by Jessy on 4/17/2024 in #❓┊help
wizard - hidden last step based on a radio option and save
The issue is with the button not re-rending after each step adding wire:key="{{uniqid()}}" to both nextStep and Submit div did the trick
<span wire:key="{{uniqid()}}"
x-cloak
x-on:click="
$wire.dispatchFormEvent(
'wizard::nextStep',
'{{ $statePath }}',
getStepIndex(step),
)
"
x-show="! isLastStep()"
>
{{ $getAction('next') }}
</span>

<span x-show="isLastStep()" wire:key="{{uniqid()}}">
{{ $getSubmitAction() }}
</span>
<span wire:key="{{uniqid()}}"
x-cloak
x-on:click="
$wire.dispatchFormEvent(
'wizard::nextStep',
'{{ $statePath }}',
getStepIndex(step),
)
"
x-show="! isLastStep()"
>
{{ $getAction('next') }}
</span>

<span x-show="isLastStep()" wire:key="{{uniqid()}}">
{{ $getSubmitAction() }}
</span>
6 replies
FFilament
Created by bernhard on 9/21/2023 in #❓┊help
Two panels with two auth guards, logges me out from both
12 replies
FFilament
Created by bernhard on 9/21/2023 in #❓┊help
Two panels with two auth guards, logges me out from both
I believe this is a candidate for a pull request
12 replies
FFilament
Created by Yuvraj Timalsina on 6/13/2024 in #❓┊help
Wizard Step did not auto scroll to reveal heading only its active state and form changed.
For future reference and as this feature is not supported now, Here is a workaround. Step (1) Add this function to your app.js (Make sure to load it in your panel)
window.scrollToElementIfNotVisible = async function (el, parent = null) {
const rect = await el.getBoundingClientRect();
const parentRect = parent ? await parent.getBoundingClientRect() : {
top: 0,
left: 0,
bottom: window.innerHeight,
right: window.innerWidth
};

const isVisible = (
rect.top >= parentRect.top &&
rect.left >= parentRect.left &&
rect.bottom <= parentRect.bottom &&
rect.right <= parentRect.right
);

if (!isVisible) {
el.scrollIntoView({behavior: 'smooth', block: 'center'});
}

}
window.scrollToElementIfNotVisible = async function (el, parent = null) {
const rect = await el.getBoundingClientRect();
const parentRect = parent ? await parent.getBoundingClientRect() : {
top: 0,
left: 0,
bottom: window.innerHeight,
right: window.innerWidth
};

const isVisible = (
rect.top >= parentRect.top &&
rect.left >= parentRect.left &&
rect.bottom <= parentRect.bottom &&
rect.right <= parentRect.right
);

if (!isVisible) {
el.scrollIntoView({behavior: 'smooth', block: 'center'});
}

}
and Add this to your wizard
$wizard->extraAttributes([
'x-effect' => <<<JS
const selector = 'li:nth-child('+(parseInt(step)+1)+')';
setTimeout(() => {
window.scrollToElementIfNotVisible(\$el.querySelector('.fi-fo-wizard-header').querySelector(selector),
\$el.closest('.fi-fo-wizard'))
}, 50);
JS,

])
$wizard->extraAttributes([
'x-effect' => <<<JS
const selector = 'li:nth-child('+(parseInt(step)+1)+')';
setTimeout(() => {
window.scrollToElementIfNotVisible(\$el.querySelector('.fi-fo-wizard-header').querySelector(selector),
\$el.closest('.fi-fo-wizard'))
}, 50);
JS,

])
3 replies
FFilament
Created by King Dice on 7/11/2024 in #❓┊help
Filter values keep existing out of nowhere.
Use this in your page
public function persistsFiltersInSession(): bool
{
return false;
}
public function persistsFiltersInSession(): bool
{
return false;
}
7 replies
FFilament
Created by Ron on 5/5/2024 in #❓┊help
How to close an ActionGroup dropdown with a custom function after the function completes
Its a bit similar: Here is an example code:
ActionGroup::make([
Action::make('test')
->action(fn() => $v = "do something")
->after(fn($livewire)=>
$livewire->dispatch('close-menu')),
])->extraAttributes([
"x-on:close-menu.window" => <<<JS
close();
JS
])
ActionGroup::make([
Action::make('test')
->action(fn() => $v = "do something")
->after(fn($livewire)=>
$livewire->dispatch('close-menu')),
])->extraAttributes([
"x-on:close-menu.window" => <<<JS
close();
JS
])
5 replies
FFilament
Created by DianaMujoiu on 2/22/2024 in #❓┊help
Wizard "nextAction" save
For anyone needing to save the wizard/form while using skippable option listen to next-wizard-step event in the create and Edit Page, for example:
#[On('next-wizard-step')]
public function onNext(){
$this->save(false,false);
}
#[On('next-wizard-step')]
public function onNext(){
$this->save(false,false);
}
38 replies
FFilament
Created by Zen Nitiruj on 5/4/2024 in #❓┊help
Working fine in local environment but fail on server
Double check the file is added to git and is pulled on server
10 replies
FFilament
Created by ericmp #2 on 8/7/2023 in #❓┊help
Is possible to use SpatieMediaLibraryImageColumn to retrieve an image of a relation model?
I used the following
Tables\Columns\ImageColumn::make('images')->getStateUsing(fn($record) =>
$record->relationship?->getMedia("collection_name")
->map(fn($image) =>
$image->getPathRelativeToRoot()
)
)
Tables\Columns\ImageColumn::make('images')->getStateUsing(fn($record) =>
$record->relationship?->getMedia("collection_name")
->map(fn($image) =>
$image->getPathRelativeToRoot()
)
)
7 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
and can you dd($user)
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
wait, from where are you running the notification?
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
are there any console issues?
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
and are there any record in the notification Table
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
No description
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
and the Panel?
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
try this format
\Filament\Notifications\Notification::make()
->title($title)
->body($textMessage)
->seconds(300)
->info()
->sendToDatabase($users)->send()
\Filament\Notifications\Notification::make()
->title($title)
->body($textMessage)
->seconds(300)
->info()
->sendToDatabase($users)->send()
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
First check whether the notification database is available
29 replies
FFilament
Created by S.V Gubadov on 4/26/2024 in #❓┊help
Laravel 11 Filament 3 database notification help
29 replies
FFilament
Created by dansing on 9/21/2023 in #❓┊help
Database Notification Actions are Not Saved on Database
This problem is very frustrating. The solution is simple: use sendToDatabase after actions are initialized.
Notification::make()
->info()
->title('Test')
->body("Test")
->actions([
ActionsAction::make('view')
->url(fn () => JobResource::getUrl('view', [$job])),
ActionsAction::make('markAsRead')
->markAsRead()
])
->sendToDatabase($job->account->user);
Notification::make()
->info()
->title('Test')
->body("Test")
->actions([
ActionsAction::make('view')
->url(fn () => JobResource::getUrl('view', [$job])),
ActionsAction::make('markAsRead')
->markAsRead()
])
->sendToDatabase($job->account->user);
When you use sendToDatabase immediately after actions, it sends the notification to the database right away. This bypasses the actions because they haven't been initialized yet. This needs to be documented.
17 replies