Alnuaimi
How to Make CreateAction Display as a Modal in FilamentPHP
Hi everyone,
I'm trying to set up CreateAction in a ListRecords page so that it appears as a modal, but the form doesn't pop up in a modal as expected.
Here’s my code:
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->modalHeading('Add New Record')
->modalButton('Add')
->modalWidth('lg')
->color('primary')
->icon('heroicon-o-plus')
->requiresConfirmation(),
];
}
I've customized the title and size, but it’s still not working. Are there any additional steps or specific settings I should check?
Thanks in advance!4 replies
How can I reduce the excess white space when using the Cluster feature ?
'm using the Cluster feature in FilamentPHP and noticed excess white space on both sides. Are there built-in solutions or CSS strategies to better utilize this space?
6 replies
Hi everyone, I'm having an issue with FilamentPHP's RichEditor component inside a Wizard form.
In my form, I have a RichEditor component inside different tabs (steps) of the wizard. The editor works fine in the first tab, but when I switch to the second or third tab, the RichEditor doesn't seem to load or function properly. Here's a simplified version of my form structure:
public static function form(Form $form): Form {
return $form->schema([
Forms\Components\Wizard::make()
->steps([
Forms\Components\Wizard\Step::make('Step 1')
->schema([
Forms\Components\RichEditor::make('description')
->label('Description')
->required(),
]),
Forms\Components\Wizard\Step::make('Step 2')
->schema([
Forms\Components\RichEditor::make('additional_info')
->label('Additional Info')
->required(),
]),
// Add more steps here...
]),
]);
}
2 replies
How to Effectively Implement Mentions System in Filament RichEditor Field?
I'm trying to implement a mentions system in a Filament RichEditor field, but I'm facing some challenges. My goal is to allow users to mention other users using "@" followed by the username, with these mentions converting into clickable links.
So far, I've tried:
Creating a custom component extending RichEditor.
Using TributeJS to implement the mentions functionality.
Customizing the Blade view file to integrate TributeJS with the Trix editor.
However, I'm still struggling with:
Efficiently loading the list of mentionable users.
Handling real-time updates to the content.
Ensuring the solution is compatible with Livewire and Alpine.js updates.
Does anyone have experience successfully implementing this feature in Filament? Any tips, code examples, or resources would be greatly appreciated.
Here's a snippet of what I've attempted:
class MentionsRichEditor extends RichEditor
{
protected string $view = 'forms.components.mentions-rich-editor';
public function getMentionsData(): array
{
return User::select('id', 'name')
->get()
->map(fn($user) => [
'key' => $user->name,
'value' => $user->name,
'link' => route('user.profile', $user),
])
->toArray();
}
}
And in the Blade view:
<div
wire:ignore
x-data="mentionsRichEditor({
state: $wire.{{ $applyStateBindingModifiers('entangle('' . $getStatePath() . '')') }},
mentionsData: {{ json_encode($getMentionsData()) }}
})"
{{ $attributes->merge($getExtraAttributes())->class(['filament-forms-rich-editor-component']) }}
>
<trix-editor
:id="$getId()"
:input="$getId() . 'Input'"
x-ref="trix"
x-on:trix-change="state = $event.target.value"
></trix-editor>
<!-- ... -->
</div>
11 replies
What is the Best Way to Encrypt a FilamentPHP Project for Local Deployment?
Hello everyone,
I have a FilamentPHP project built with Laravel, and I want to protect the source code from being altered or viewed when deploying it locally (for example, using Laragon or other local servers). I’m exploring the best method to encrypt or obfuscate the code to prevent unauthorized access, but still allow the project to run without issues.
I’ve come across a few options like phpBolt, ionCube, and PHP Obfuscators, but I’m looking for advice from anyone who has successfully implemented encryption or obfuscation in a Laravel-based project, particularly for Filament.
What are the best tools or methods for encrypting or obfuscating PHP code locally?
Are there any specific considerations I should keep in mind for a Filament project?
What are the trade-offs in performance or maintainability when using these tools?
Any recommendations or best practices would be greatly appreciated!
Thank you:fi: :fi:
8 replies
How to Fix 'Call to undefined method' Error in Inherited Laravel Model?
I have created a new model in Laravel that extends a model from the vendor directory and added a new method (getNextApprovers) to the new model. However, when calling this method, I receive a Call to undefined method error. I have tried using __call and Traits, but the issue persists. How can I resolve this issue and ensure that the method works correctly in the new model?
14 replies
How to Create an Organizational Chart in FilamentPHP?
Hi everyone,
I'm working on a project using FilamentPHP and I would like to add an organizational chart to display the structure of my company. I've tried using some libraries like OrgChart.js but I'm having trouble integrating it properly with Filament.
Could someone guide me on how to set up and display an organizational chart using FilamentPHP? Any tips on suitable libraries and how to integrate them, or code examples would be greatly appreciated.
Thank you very much!
2 replies