rabol
rabol
FFilament
Created by rabol on 6/14/2024 in #❓┊help
Is it possible to make the toggle column dropdown scrollable?
No description
7 replies
FFilament
Created by rabol on 5/9/2024 in #❓┊help
TypeError on resource where column is an Enum
I have a User Model, and did like this: php artisan make:filament-resource UserResource -G
and when I try to view the users i get this:
Filament\Tables\Columns\TextColumn::Filament\Tables\Columns\Concerns\{closure}(): Return value must be of type ?string, App\Enums\UserLevelEnum returned
Filament\Tables\Columns\TextColumn::Filament\Tables\Columns\Concerns\{closure}(): Return value must be of type ?string, App\Enums\UserLevelEnum returned
I get it even if I remove the column that uses enum the enum:
enum UserLevelEnum: int implements HasLabel
{
---
}
enum UserLevelEnum: int implements HasLabel
{
---
}
What am I missing ?
26 replies
FFilament
Created by rabol on 3/28/2024 in #❓┊help
is there a 'before the create button is clicked hook'
It might not be a big issue, but I just discovered that in one have a upload comonemt in a form e.g. like this:
Forms\Components\FileUpload::make('thumbnail')
->disk(config('filesystems.default'))
->directory('articles')
->visibility('public')
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
])
->required(),
Forms\Components\FileUpload::make('thumbnail')
->disk(config('filesystems.default'))
->directory('articles')
->visibility('public')
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
])
->required(),
while this works it will give issues in some cases where the 'filesystems.default' is set to 'local' or if the the configuration does not have a 'url' key, in that case it would be nice to be able to do some validation even before allowing the user to create a new record. I know that there is beforValidate() and beforCreate(), but in this case the user has already entered some information in the form is there a way to do something just before the create button is pressed ?
2 replies
FFilament
Created by rabol on 3/22/2024 in #❓┊help
How can I always use the App login page and never the Filament login page
Hi Is there a way to make sure that the 'normal' login page is always used instead of the Filament login page ? I have tried to add
->loginRouteSlug('login')
->loginRouteSlug('login')
in the AdminPanelProvider but when trying to access /admin it redirect to admin/login and show the Filament login page
4 replies
FFilament
Created by rabol on 3/18/2024 in #❓┊help
confirm dialog looks strange
No description
5 replies
FFilament
Created by rabol on 11/3/2023 in #❓┊help
how do I get the active locale to be used in a translatable select
I have a translatable resource and this resource have a belongsTo relationship to another translatable resource Both resources are created with the -S option FaqCategory and Faq ar both translatable When creating a new Faq, I have this:
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
->required(),
Forms\Components\TextInput::make('body')
->required(),
Forms\Components\Select::make('faq_category_id')
->relationship(name: 'category', titleAttribute: 'name->en'),
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
->required(),
Forms\Components\TextInput::make('body')
->required(),
Forms\Components\Select::make('faq_category_id')
->relationship(name: 'category', titleAttribute: 'name->en'),
]);
}
It works, but I always get the 'English' name in the select I can see that the trait on the
ManageFaqs
ManageFaqs
has a getActiveTableLocale(), but as it's not a static methodI cannot call that in my resource, so how do I get the active locale
2 replies
FFilament
Created by rabol on 11/3/2023 in #❓┊help
does filament-spatie-translatable work when the resource is generated with -S option
For a FAQ 'module' I'm trying to use the https://filamentphp.com/plugins/filament-spatie-translatable plugin, I have added the plugin to the panel. I then generated the resource
php artisan make:filament-resource FaqCategory -G -S
php artisan make:filament-resource FaqCategory -G -S
I have added the
use Translatable;
use Translatable;
to the resource but the create and editdoes not have controls for the translations
6 replies
FFilament
Created by rabol on 9/26/2023 in #❓┊help
Link in admin panel
Hi In V2, the link in the upper left corner of the panel was going to the frontend, but now it goes to /admin Is there a way to get the 'old' function back ?
7 replies
FFilament
Created by rabol on 9/25/2023 in #❓┊help
Problems pasing parameters to pages in a plugin
I'm having trouble to pass parameters to a page my log viewer plugin. I'm using Sushi as my 'record' so I cannot have a normal Filament resource I have 3 pages the main page that list the log files - works, no problem the log file page that lists the entries in the log file - some how it works the log file entry page that shows details of a log entry - does not work at all all 3 pages is registered in the plugin like this:
public function register(Panel $panel): void
{

$panel
->pages([
LogViewerPage::class,
LogViewerViewLogPage::class,
LogViewerViewDetailsPage::class,
]);
}
public function register(Panel $panel): void
{

$panel
->pages([
LogViewerPage::class,
LogViewerViewLogPage::class,
LogViewerViewDetailsPage::class,
]);
}
In LogViewerPage I have a table, and this is how I generate the actions
protected function getTableActions(): array
{
return [

Tables\Actions\Action::make('viewlogfile')
->label('View')
->url(function (LogFile $record) {
return LogViewerViewLogPage::getUrl(['fileName' => $record->name]);
}),

Tables\Actions\Action::make('delete')
->action('deleteLogFile')
->requiresConfirmation()
->hidden(fn ($record) => ! static::canDelete($record)),

];
}
protected function getTableActions(): array
{
return [

Tables\Actions\Action::make('viewlogfile')
->label('View')
->url(function (LogFile $record) {
return LogViewerViewLogPage::getUrl(['fileName' => $record->name]);
}),

Tables\Actions\Action::make('delete')
->action('deleteLogFile')
->requiresConfirmation()
->hidden(fn ($record) => ! static::canDelete($record)),

];
}
in LogViewerViewLogPage the mount() throws an error Unable to resolve dependency [Parameter #0 [ <required> $fileName ]] in class Rabol\FilamentLogviewer\Pages\LogViewerViewLogPage the url looks like this:
/admin/log-viewer-view-log-page?fileName=worker.log
/admin/log-viewer-view-log-page?fileName=worker.log
public function mount($fileName): void
{
$this->log = LogReader::filename($fileName);
$this->logEntries = $this->log->get(); // we need to paginate...
self::$title = 'Log file: '.$fileName;
$this->fileName = $fileName;
}
public function mount($fileName): void
{
$this->log = LogReader::filename($fileName);
$this->logEntries = $this->log->get(); // we need to paginate...
self::$title = 'Log file: '.$fileName;
$this->fileName = $fileName;
}
any hint on what I'm missing ?
15 replies
FFilament
Created by rabol on 9/25/2023 in #❓┊help
routes in plugin
How do I register routes for pages in a plugin ?
4 replies
FFilament
Created by rabol on 9/25/2023 in #❓┊help
plugin upgrade
Hi I'm trying to upgrade my filament-logviewer plugin I have used the 'skeleton' plugin (did you check the skeleton https://github.com/filamentphp/plugin-skeleton) The plugin get's installed, but it does not show up in the admin panel automatically I'm sure I missed something, but not really sure what
8 replies
FFilament
Created by rabol on 9/21/2023 in #❓┊help
how to make the list page take up the full with
Hi How can I get the the ListPage of a resource take up the full with ?
6 replies
FFilament
Created by rabol on 8/24/2023 in #❓┊help
Getting 404 when loading assets
Hi My Filament admin panel has been working for some time, but just today I get a 404 when loading the assets If i try to access the assets directly https://xxxx/filament/assets/app.css?id=ceb9a486dfc44ebe8adaa3bd510821e8 I get the the css but when loading the panel the css is not loaded and in the console I can see 404 errors Yes, I have found other discussions here and it does not solve my issue
60 replies
FFilament
Created by rabol on 7/31/2023 in #❓┊help
acceptedFileTypes reject valid file types
I have this on a Fileupload:
->acceptedFileTypes(['application/json', 'json', 'application/msword', 'docx'])
->acceptedFileTypes(['application/json', 'json', 'application/msword', 'docx'])
I have tried this as well:
->acceptedFileTypes(['docx'])
->acceptedFileTypes(['docx'])
but when I select a .docx file I get an error saying: 'File of invalid type'
22 replies
FFilament
Created by rabol on 7/18/2023 in #❓┊help
How do I get the file in a upload action
on a resource page I have an action:
Tables\Actions\Action::make('import')
->form([
Forms\Components\FileUpload::make('file'),
])
->label('')
->tooltip('Import')
->icon('heroicon-o-folder-open')
->action('import'),
Tables\Actions\Action::make('import')
->form([
Forms\Components\FileUpload::make('file'),
])
->label('')
->tooltip('Import')
->icon('heroicon-o-folder-open')
->action('import'),
shows a modal, one can upload a file and it call my 'import' method. But... what parameters do I get in my method? I would lige to get the current record and then the fileupload so that I can 'import' the data in this case
public function import($record, $file)
{

dd($record, $file);
}
public function import($record, $file)
{

dd($record, $file);
}
Does not work
10 replies
FFilament
Created by rabol on 7/3/2023 in #❓┊help
getFormSchema is called on every 'next' in a wizard
Hi it looks like the getFormSchema is called every time you press next in a wizard. First I saw that it was taking a very long time when pressing the 'next', so I started to investigate Here is a simple wizard that shows the error:
19 replies
FFilament
Created by rabol on 6/29/2023 in #❓┊help
No property found for validation
Hi I'm dynamically building a wizard, it shows perfectly fine, but when I hit 'Next' I get this error:
No property found for validation: [placeholder_1_grp_1]
No property found for validation: [placeholder_1_grp_1]
What did I miss ?
12 replies
FFilament
Created by rabol on 6/28/2023 in #❓┊help
where is filament-forms-wizard-component-header defined
Hi I'm trying to have a custom view for a wizard and need to build the css. vscode and phpstom cannot find filament-forms-wizard-component-header Where i 'filament-forms-wizard-component-header' defined ?
4 replies
FFilament
Created by rabol on 6/26/2023 in #❓┊help
Submit is visible in wizard even if it's not the last step
Hi Not sure if it's by design or a bug, but it seems like the 'Submit' is visible on all 'steps' of a wizard, even if you are not on the last page
11 replies
FFilament
Created by rabol on 6/26/2023 in #❓┊help
iframe component
Hi has anyone made a iframe field for the form builder ? or is it is as simple as View::make('my_view',$data)?
5 replies