Tuto's Laravel Corner

TLC

Tuto's Laravel Corner

Join the community to ask questions about Tuto's Laravel Corner and get answers from other members.

Join

🚀laravel

💡filament

Validation doesn't work on form created with createOptionForm

Folks, I used the createOptionForm function to enable a new record creation form in a select field. Unfortunately, on this form, the unique() validation is not working. I followed a tip from Povilas in the code below, also without success: ```php // Document comes from a Leandro Ferreira package for document fields in pt_BR Document::make('cpf')
->label('CPF')...
Solution:
I implemented something similar, but without using any third party packages (Document) and the validation works as expected. Here's an example of a dropdown with the option to create a new user. The unique validation is added to the email field ```php Forms\Components\Select::make('owner_id') ->relationship('owner', 'name')...

TinyMce in filamentphp as a customField

I want to use TinyMCE in my form builder, but I can't. When I use the script inside my custom view, TinyMCE loads, but it disappears when I use a reactive() or any real-time functionality like a wizard. Additionally, when I hit "create", it won't send the data and I get the error "title cannot be null". I also tried registering the TinyMCE script file as the Filament documentation suggests (https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files). I can see the script file when I inspect the page, but TinyMCE won't load. Here's my custom-textarea.blade.php file: ```<textarea{{ $applyStateBindingModifiers('wire:model') }}="{{ $getStatePath() }}"></textarea> <script src="https://cdn.tiny.cloud/1/cet2a3k5g1bxun5sp9vc8cka2nxji3ts1xrt1sz4h1oazm1g/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>...
No description

Making tabs for edit page

There used to be a package for version 2: https://github.com/aymanalhattami/filament-page-with-sidebar Unfortunately doesn't support V3 yet (there's a push for it, but in testing, it doesn't work). I see issues reported for that, but for now, is there a Filament way to do some kinda tabs like that plugin does?...

can you explain how to send a email invitation when you add a new doctor ?

How we can send an email when you create another doctor , and also how to use the verification email for every new admin

Example UserResource with Password reset button

```php public static function table(Table $table): Table { return $table ->columns([...

Problem with relationmanager

I've a bit of a struggle with table list/form. I've made a table list with customers, within the edit of the customer I've integrated two relation managers. - One: With customer contact persons. - Two: With notes of the customer....

How to set company_id in role_user table

I'm able to assign roles and everything works great, but the currently logged in company_id (multi-tenancy) doesn't get saved to the pivot table (remains null) Is there a way to set the pivot table with the currently logged in company_id when assigning roles to a user? I'm using a UserResource to do this, and I just add the roles selector component using:...

Hide column in table conditionally

I checked the documentation and all they give is the attached image example... What I need to do is hide a column if another column has a value In this specific example:...
No description

Pivot table issue

When creating a new Company Litter, I have a pivot table called company_litter that gets filled automatically by Filament But for some reason it's still requiring a company_id field in the litters table Filament fills in the company_id in the litters table, as well as the company_litter table...

How to customize Table/List view

I'm trying to get rid of the table completely inside of the resource, and replace the results with cards Is this possible?...

How to check user roles in canAccessPanel()

Hello, I can't seem to find the code to use to check if a role is assigned to a user from database into canAccessPanel() I need to check: role_user pivot table...