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

What do you think is the best way to do this?

I have a schedule table where users can enter their schedules. Based on that schedule (which should be hours a o'clock or half past) I create slots (in the slots table of my database) of 30 min to schedule appointments. Here is an example: The user sets his schedule on Mondays from 10:00 to 12:00. When saving it in the Schedule table, the following available slots are automatically created in the slots table like this: (FK) schedule_id: 1...
Solution:
sorry I didn't answer sooner. Thank you very much for replying. Unfortunately I am very tight on time and can't afford to follow a course right now. Anyway, in case anyone is interested, I'm doing it with the CreateSchedule page, adding some things in a afterCreate() function. Through this function, that is always executed everytime you create a schedule, I create the Slots. Is this the best way to do it? possibly not (certainly not). But it works and for the moment it works for me hahaha.

custom registration form in filament

Maybe this is a stupid question, but it is not clear to me from the official documentation how to do it. I want to customize the default registration form in filamentPHP. to add new fields. In this part of the documentation: https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features I don't understand this part very well: ...
Solution:
my whole code in case it can help someone (you also have to specify in your panelProvider the registration form you want to use, in my case i added: ->registration(Register::class) and the whole code of mi Register.php file: ...

I can't use searchable, sortable or bulk actions in a clean installation

I don't know if it has happened to anyone: I have a clean installation of filament, I have only created a model and a resource, I have just put some fields in my form and my table so the installation is practically clean. When I try to use the searchable and sortable functions, the page is reloaded and put like an almost black layer on top of the search, you can barely see the table with the searched item below. If I refresh the page with F5, then it shows me what I wanted to filter without this...
Solution:
I have solved it, I leave here the solution in case someone needs it. Thanks to this thread: https://www.answeroverflow.com/m/1323048980388642817 In my composer.json file, my filament version looked like this: ā€œfilament/filamentā€: ā€œ3.2ā€. I changed it to ā€œfilament/filamentā€: ā€œ^3.2ā€, and did composer upgrade (I noticed that some commands like php artisan filament:optimize were not recognized, and that had to be some problem with the installation) That solved everything...
No description

Veterinary appointment app

Hi everyone! I am new to the server. I would like to create a project of a veterinary clinic, where there are owners and veterinarians. I have been doubting a lot whether to make my application with filament or not. The main idea is to have an appointment management system where vets can put their available schedules and owners can schedule appointments for their pets. I wanted to do something like the calendars that are in some restaurants to book a table, where you can see what days they have openings and within those days choose a time slot available. I have several doubts: 1. do you think that all this can be implemented with filament or should I do a clean installation of laravel? (I don't have much time to do the project so that's why though about filament) 2. I am concerned about the calendar and the integration of appointments. Can I use external resources/libraries that are not made for filament? do you know any library in filament that can help me with the appointment calendar (and that is free...)?...

Passing an argument to a custom table action

``` ->actions([ Tables\Actions\EditAction::make(), \Filament\Tables\Actions\Action::make('Generate QR Codes') ->label('QRCodes')...

Error: algolia serach

Hi, I am trying your car used script. when I try to create a car I get following error: Please install the suggested Algolia client: algolia/algoliasearch-client-php. Can you please help...

How can I pre-fill or pre-check records from the table?, is possible?

Does anyone know if it is possible to mark the default check boxes in a table(bulk action)? I have used $selectedTablerecord and $selectedRecors and neither of them have worked for me?

Policies controls

Hello šŸ˜Š I have a page named "TeamVehicle" and before showing it, I wanted to check if there is any package related to "TeamPackage". I checked if a package was created below. What I want to know is whether the code I wrote below is correct or not. And actually this works without any problems. I wanted to learn this so I could write cleaner and smoother code. ```php // TeamVehiclePolicy.php...

Filament PHP

Hello Arturo @tuto1902 I finally have a case that seems very complicated to implement in a Filament project: I want to create a sales system with cart management in a multi-tenant Filament project. For example: the user logs into the panel and clicks on the sales tab. The system displays the order page. On this interface, there is a search bar where the user must enter the product name. The system displays products related to the entered word. Once the product is displayed, if it is in stock, i...

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
Next