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

fetch disabledDates() Data ->afterStateUpdated in other formfield

Hello folks, I'm currently creating a small rental system where I assign different booking positions to bookings (BookingTable) via a repeater. I can choose one item per position and have a DateRangePicker from Filament Plugin by Malzariey. Now to the problem: When I change the item, a "->afterStateUpdated"- function must be triggered so that the data in the DateRangePicker for the ->disabledDates() function is updated. The goal for this item is to display all already occupied periods from the database in the calendar. ...
No description

Spatie Settings with Filament CheckboxList

Hello gents. I am posting here a topic which I've also posted in Filament but so far could not get any luck figuring out the things. My idea was to build a Filament-Starter-Kit which can be freely used to download, install and have a full admin panel with Filament + Jetstreal (using last one to allow 2FA) + Settings page with an example for every input and many other plugins I manage to install like Spatie Roles& Permissions, Backup etc....
Solution:
Nevermind, Tuto, I've figured it out, it was just that in the DB I did not define the initial column payload as [] but '' and not sure why but since I switched to that and set my variable as an array type, I got it working perfectly. So my current settinfs page has the following definitions (in case you ever fall into this, despite I doubt it): GeneralSettingsPage.php...

Action column Label

Hello all. Maybe it sounds like a silly question but I can't seem to find a way to set the Filament Table Actions column with a label and that the label is left aligned as the rest of the columns are. Yes, I am able to set the Actions table column label and yes, I can align the actions myself manually but how about the Column Label itself as the label 'Actions' I set always remain to right even if I set the actions alignment to be Left......

Navigation Groups order

Hello all. I've got into the same trouble as the author of the post, however adding the navigastionGroups to AdminPanelProvider does not seem to resolve my navigation groups order and instead they are ordered in an Alphabetical order. Here is my navigationGroups markup:...

Multiple sub domain session sharing

How can I share user sessions between two Filament dashboards running on different subdomains (e.g., admin.example.com and dashboard.example.com) that use the same Laravel codebase and database? I want users to remain logged in when switching between these dashboards I've already set SESSION_DOMAIN=.example.com in my .env file, but it's not working[it doesn't redirec to the dashboard page for both]. What other configurations or code changes might I need to make this work?...
Solution:
it's was just browser cache

Filament Labels not showing in bold

Hey @tuto1902 , all I am following the LMS tutorial videos rthat I've started live, but had to postpone because of some work required on another project and now that I am back I've noticed some minor issue that buggs me a bit and I can't seem to figure out what is causing it. It all works as the demo says and I had to do some fine tuning as the LMS Series were finished around mid January and ever since Filament and Livewire (I believe so) has also updated in versions which caused some installation conflicts to resolve....

Filamentphp Custom page with a table inside

the submitted images are the steps i followed and the resultant error i am getting, i don't understand where the infolist is coming from
No description

Kanban

Hi! do you plan to make the Laravel Kanbab Board a Filament component?

Building a multi step form registration using laravel jetstream

I'm having difficulty in creating a from with multiple steps using jetstream

Refresh sub navigation after save

I have created an edit page for a Resource that should only show based on a field value. I am using the canAccess static method to check the value in the record and it works great, if the value is not valid and you try to access the page you get a 403 error and the sub-navigation item is added/removed accordingly but I need to manually refresh the page to actually see the change in the sub-navigation. Is there a way to force the sub-navigation to refresh after the form is saved to automatically add or remove the link to the page?...
Solution:
Ok so the solution I've found for now is to overwrite the getRedirectUrl() method on the Edit class: ``` protected function getRedirectUrl(): ?string {...

State - City select fields

I have this code, got from the filament documentation ```php Select::make('state_id') ->searchable()...
Solution:
```php Select::make('author_id') ->searchable() ->getSearchResultsUsing(fn (string $search): array => User::where('name', 'like', "%{$search}%")->limit(50)->pluck('name', 'id')->toArray()) ->getOptionLabelUsing(fn ($value): ?string => User::find($value)?->name),...

TAB pagination reset

My problem is that opening from a table a modal window that contains tabs, when I click on a tab the page of the table is reset. How do I avoid this?

Filter Filament Project Resources Based on Authenticated User's Team

I'm working on a Laravel application with a Filament admin panel. I need to filter the projects displayed in the admin panel so that only projects related to the authenticated user's team are shown. Here's a summary of my setup and what I've tried so far: Database Schema: User: belongs to a Team...
No description

Enable/Disable Login method

Hi, Does anybody have an idea about enabling or disabling login during the boot process? I think it's a bit tricky....

Searchable for models/relationships with different database connections

I have a model with a connection to another database, when it appears in the list table it doesn't have a problem, but when the fields of the model are given searchable parameters an error occurs, it seems the error is because the search query is not connected to another database. is there a solution for this?
No description

Loop certain data inside filament $form schema

Hi @tuto1902 , Is there's a way on how can I loop or show certain data inside the $form schema. I am using ->afterStateUpdated in side the $form ->schema. I want to show data from the database inside the $form ->schema. Thank you for the help....

Populate repeater using a select field outside of repeater rather than using the repeater add button

This is my code. Hoe do i use this select filed to poupulate my repeater. Forms\Components\Select::make('scan_code')...
Next