jgreco
jgreco
FFilament
Created by jgreco on 5/29/2024 in #❓┊help
Fileupload on registration page - 419 error
UPDATE: session()->regenerate(); is what causes this to happen. Overrode the register() method and removed this line. It's a bit glitchy but it works without the 419 error. I assume the session becomes invalid before the fileupload can finish saving. Is there any negative implication to not regenerating the session during registration?
6 replies
FFilament
Created by Augus on 9/28/2023 in #❓┊help
Custom error pages
Unfortunately, I don't see a quick way (like in v2), just yet. You can copy vendor/filament/filament/resources/views/components/layout/base.blade.php into your own layout file, remove all references to $livewire, then you will be able to use Filament UI components to build out the page
21 replies
FFilament
Created by Augus on 9/28/2023 in #❓┊help
Custom error pages
Hmm, the logo... one moment
21 replies
FFilament
Created by Augus on 9/28/2023 in #❓┊help
Custom error pages
here's the Blade component for the simple page:
@props([
'heading' => null,
'subheading' => null,
])

<div {{ $attributes->class(['fi-simple-page']) }}>
<section class="grid auto-cols-fr gap-y-6">
<x-filament-panels::header.simple
:heading="$heading ??= $this->getHeading()"
:logo="$this->hasLogo()"
:subheading="$subheading ??= $this->getSubHeading()"
/>

{{ $slot }}
</section>

@if (! $this instanceof \Filament\Tables\Contracts\HasTable)
<x-filament-actions::modals />
@endif
</div>
@props([
'heading' => null,
'subheading' => null,
])

<div {{ $attributes->class(['fi-simple-page']) }}>
<section class="grid auto-cols-fr gap-y-6">
<x-filament-panels::header.simple
:heading="$heading ??= $this->getHeading()"
:logo="$this->hasLogo()"
:subheading="$subheading ??= $this->getSubHeading()"
/>

{{ $slot }}
</section>

@if (! $this instanceof \Filament\Tables\Contracts\HasTable)
<x-filament-actions::modals />
@endif
</div>
21 replies
FFilament
Created by Augus on 9/28/2023 in #❓┊help
Custom error pages
@DrByte I haven't implemented in v3 yet, but you can most likely accomplish the same using <x-filament-panels::page.simple>
21 replies
FFilament
Created by jgreco on 8/21/2023 in #❓┊help
Toggleable columns not working with Split
^ That's correct, and I understand that. But I think the bigger issue is that toggleable stops working with a Split?
5 replies
FFilament
Created by Josh777 on 7/11/2023 in #❓┊help
Hide all resources depending on user
adjust the logic within the filter method. I haven't tested this, but in theory it might do what you need
12 replies
FFilament
Created by Josh777 on 7/11/2023 in #❓┊help
Hide all resources depending on user
Correct. You could put this method in a trait and re-use it, if you wanted. If, for some reason, you absolutely must manage this from a Provider, maybe something like this might work?
Filament::serving(function () {

$resources = collect(Filament::getResources())->filter(function ($resource) {
return !str($resource)->contains('TeamResource');
})->toArray();
Filament::registerResources($resources);
Filament::serving(function () {

$resources = collect(Filament::getResources())->filter(function ($resource) {
return !str($resource)->contains('TeamResource');
})->toArray();
Filament::registerResources($resources);
12 replies
FFilament
Created by Josh777 on 7/11/2023 in #❓┊help
Hide all resources depending on user
when the viewAny permission is false, the entire resource is disabled. Then you don't have to create all of the model policies
12 replies
FFilament
Created by Josh777 on 7/11/2023 in #❓┊help
Hide all resources depending on user
Not sure of a way to handle this from a Provider, but I've done this within the Resource files (ex. UserResource.php):
public static function canViewAny(): bool
{
return auth()->user()->is_admin;
}
public static function canViewAny(): bool
{
return auth()->user()->is_admin;
}
12 replies
FFilament
Created by jgreco on 5/15/2023 in #❓┊help
Wizard step overflow-y-hidden not hiding child elements from other steps
14 replies
FFilament
Created by jgreco on 5/15/2023 in #❓┊help
Wizard step overflow-y-hidden not hiding child elements from other steps
Nope, still works 🤷‍♂️
14 replies
FFilament
Created by jgreco on 5/15/2023 in #❓┊help
Wizard step overflow-y-hidden not hiding child elements from other steps
I've, so far, tried skippable and the validation hooks (trying to break it) but seems to be working still. Found this: https://github.com/filamentphp/filament/pull/1997/files, maybe FilePond?
14 replies
FFilament
Created by jgreco on 5/15/2023 in #❓┊help
Wizard step overflow-y-hidden not hiding child elements from other steps
I've tested validation and form submission using hidden instead, and it seems to work. Is invisible being used for transition purposes?
14 replies