Chili con Timo
Chili con Timo
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
this works now as expected
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
uuuuhhh nice 🙂 thanks a lot! I only had to cover the mountAction part inside an if which should only be called when user is not a admin 🙂
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
is this a kind of preloading of the action without rendering it/the button?
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
hmm i have searched it there but did not find it. but it is completely logic -> i am in the else part and so the $this->customerLocationModalAction is never triggered. okay the whole requirement of this feature: admin should get a button which opens a modal where he/she can select the location (currently implemented). the normal user should not see this button, but after login the same modal should open and force him to select the location.
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
yep and i dont have one
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
this componeent is loaded beside the user profile icon
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
but the open-modal part is not working atm
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
here is a sample snippet of the blade template of the livewire component:
<div>
@if ($isAdmin)
@if ($customerLocation !== '')
<span class="mr-4 ml-8">{{ $customerLocation }}</span> {{ $this->customerLocationModalAction }}
@else
{{ $this->customerLocationModalAction }}
@endif
@else
@if ($customerLocation !== '')
{{ $customerLocation }}
@else
@script
<script>
document.addEventListener("DOMContentLoaded", function() {
window.dispatchEvent(new CustomEvent('open-modal'))
});
</script>
@endscript
@endif
@endif
<x-filament-actions::modals />
</div>
<div>
@if ($isAdmin)
@if ($customerLocation !== '')
<span class="mr-4 ml-8">{{ $customerLocation }}</span> {{ $this->customerLocationModalAction }}
@else
{{ $this->customerLocationModalAction }}
@endif
@else
@if ($customerLocation !== '')
{{ $customerLocation }}
@else
@script
<script>
document.addEventListener("DOMContentLoaded", function() {
window.dispatchEvent(new CustomEvent('open-modal'))
});
</script>
@endscript
@endif
@endif
<x-filament-actions::modals />
</div>
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
the livewire component is already there and injected in the page header but uses the FormBuilder trigger button solution xD
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
isnt it possible to call ich directly over e.g. livewire dispatch? I found some documentation with custom blade template, but i want/need to use the form builder here.
22 replies
FFilament
Created by Chili con Timo on 3/7/2025 in #❓┊help
Filament 3.x: How to open a modal from blade template
Okay I was not specific enough. the modal should open after a user was logged in. so the page could be any page of the app.
22 replies