Krzysztof
Krzysztof
FFilament
Created by Krzysztof on 10/13/2024 in #❓┊help
ViewAction slideOver render hook
I got some guidance when I needed to inject a view on a view page itself: https://github.com/filamentphp/filament/pull/14480 But this time I don't see any render hooks that would be appropriate for the use case
2 replies
FFilament
Created by Krzysztof on 10/7/2024 in #❓┊help
Custom FileUpload
If anyone is interested, what I end up doing is a custom component with setUp method overriden like that:
<?php

class CustomFileUpload extends FileUpload
{
protected function setUp(): void
{
parent::setUp();

$this->afterStateHydrated(function (BaseFileUpload $component, string|array|null $state): void {
$path = ...
$component->state([((string) Str::uuid()) => $path]);
});

$this->deleteUploadedFileUsing(function ($file) {
// delete here
});

$this->afterStateUpdated(function (BaseFileUpload $component, $state) {
if ($state instanceof TemporaryUploadedFile) {
// upload via api
}

if (blank($state)) {
return;
}

if (is_array($state)) {
return;
}

$component->state([(string) Str::uuid() => $state]);
});
$this->getUploadedFileUsing(static function (BaseFileUpload $component, string $file, string|array|null $storedFileNames): ?array {
$url = ...
$file = ...

return [
'name' => basename($file),
'size' => $shouldFetchFileInformation ? $storage->size($file) : 0,
'type' => $shouldFetchFileInformation ? $storage->mimeType($file) : null,
'url' => $url,
];
});
}
}
<?php

class CustomFileUpload extends FileUpload
{
protected function setUp(): void
{
parent::setUp();

$this->afterStateHydrated(function (BaseFileUpload $component, string|array|null $state): void {
$path = ...
$component->state([((string) Str::uuid()) => $path]);
});

$this->deleteUploadedFileUsing(function ($file) {
// delete here
});

$this->afterStateUpdated(function (BaseFileUpload $component, $state) {
if ($state instanceof TemporaryUploadedFile) {
// upload via api
}

if (blank($state)) {
return;
}

if (is_array($state)) {
return;
}

$component->state([(string) Str::uuid() => $state]);
});
$this->getUploadedFileUsing(static function (BaseFileUpload $component, string $file, string|array|null $storedFileNames): ?array {
$url = ...
$file = ...

return [
'name' => basename($file),
'size' => $shouldFetchFileInformation ? $storage->size($file) : 0,
'type' => $shouldFetchFileInformation ? $storage->mimeType($file) : null,
'url' => $url,
];
});
}
}
3 replies
FFilament
Created by PabloZagni on 8/14/2024 in #❓┊help
Show file uploaded in Infolist
14 replies
FFilament
Created by gausoft on 8/18/2024 in #❓┊help
How to use different logos for the login and the sidebar ?
You can pass a closure to the brandLogo so I guess you should be able to differentiate between login page and other pages using request/url
10 replies
FFilament
Created by Sidem on 8/18/2024 in #❓┊help
livewire action
You can also use repeater so you have only one component where you add your distribs
5 replies
FFilament
Created by Sidem on 8/18/2024 in #❓┊help
livewire action
I've added an infolist with a custom view (using view and viewData to pass props) and an entry has an action method so the whole entry is clickable
5 replies
FFilament
Created by Krzysztof on 8/18/2024 in #❓┊help
Testing formActions
I've tried testing this way with no luck:
Livewire::test(EditUser::class, [
'record' => $user->id,
])
->fillForm([
'name' => 'New name',
])
->callAction('saveBasicDetails')
->assertHasNoErrors();
Livewire::test(EditUser::class, [
'record' => $user->id,
])
->fillForm([
'name' => 'New name',
])
->callAction('saveBasicDetails')
->assertHasNoErrors();
Failed asserting that an action with name [saveBasicDetails] exists on the [Workflou\Filament\Resources\UserResource\Pages\EditUser] page. Failed asserting that null is an instance of class Filament\Actions\Action.
2 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
thanks for help! as I stated before it was some versioning issue. Even though the composer.lock had the right version, the old version of filament has been installed in vendor folder. I've removed vendor, reinstalled with composer and had to also remove storage/framework/views cache and it's working
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
I think I found the issue, somehow Laravel decided to install the older version of filament. So the assets are fresh but the html comes from before 5 months (when the ! was introduced). Will post an update when I'll find the cause of my stupidity 🙂
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
no changes, also I did not use php artisan filament:cache-components so it should not matter?
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
clearing cache does not help
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
don't know it that can cause issues though, probably just a cache bump
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
But filament/filament package and filament/support are on 3.2.97
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
did not help, but I've notice the difference in assets cache tag, the fresh Laravel app loads http://filament.test/css/filament/filament/app.css?v=3.2.97.0 whis is the right version, but the package loads http://workflou.test/css/filament/filament/app.css?v=3.2.40.0. The 3.2.40 matches filament/actions package version (in both cases)
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
v3.2.97 in composer.lock for both
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
but will try updating to double check
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
yep
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
Could it be some Tailwind configuration that strips the ! from classes? 🤔
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
There is nothing without the !
20 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
When I search vendor folder for the class, I only get this one occurrance:
null => '!max-w-[14rem]',
null => '!max-w-[14rem]',
inside dropdown/index.php
20 replies