Hi Povilas.
There is a little problem that we can't create a new Property if we haven't any Apartments now.
And we can't add an Apartment without Property.
I think the main entity here is a Property but not an Apartment.
Oh now I understood the problem. according to the logic of the application, admins don't create apartments and properties, users do that via api, admins only edit them via filament adminpanel.
It would not be logical if admins added properties for someone.
Just wanted to say that it's better to remove the "preload()" for Property dropdown from ApartmentResource.php (Edit Apartment) => Forms\Components\Select::make('property_id')
I used the Performance Seeds from related course and I have thousands of properties (99k) and didn't know why the Edit Apartments page was loading in 30 seconds.
I noticed the preload(), it loads all 99k properties on that dropdown, so it's better to remove it. :)
Thank you for all courses and especially for 'Booking' ones!
PropertyRelationManager seems a bit confusing because in our system, an Apartment belongs to a Property rather than having a belongs to many relationship. I would directly include the action for creating a Property within the select.
In app/Filament/Resources/ApartmentResource.php:
there is mistake one line => RelationManagers\PropertiesRelationManager::class,
should be => RelationManagers\PropertyRelationManager::class,
Thank you, dear Editor of our team :) Fixed now!
Hi Povilas. There is a little problem that we can't create a new Property if we haven't any Apartments now. And we can't add an Apartment without Property. I think the main entity here is a Property but not an Apartment.
I think it worked well for me: first create a property, then apartments inside of it. What error are you getting when creating a property?
The problem is I can't get a Property add form if I haven't any Apartments. This is 2 examples what I say: https://disk.yandex.ru/i/OwP2oG3Omb2DDQ https://disk.yandex.ru/i/6rsX_IvwRp88fw How to create a Property in this case? :)
Oh now I understood the problem. according to the logic of the application, admins don't create apartments and properties, users do that via api, admins only edit them via filament adminpanel.
It would not be logical if admins added properties for someone.
Yes, that's right, agree with you. Thanx
Hi Povilas, Nice course.
Just wanted to say that it's better to remove the "preload()" for Property dropdown from ApartmentResource.php (Edit Apartment) => Forms\Components\Select::make('property_id')
I used the Performance Seeds from related course and I have thousands of properties (99k) and didn't know why the Edit Apartments page was loading in 30 seconds. I noticed the preload(), it loads all 99k properties on that dropdown, so it's better to remove it. :)
Thank you for all courses and especially for 'Booking' ones!
Hi, thanks for the kind words and a suggestion. We will take a look if that makes sense as an edit here or maybe a separate article as a warning
Sadly
hasCombinedRelationManagerTabsWithFormis no longer an option in Filament v3.PropertyRelationManager seems a bit confusing because in our system, an Apartment belongs to a Property rather than having a belongs to many relationship. I would directly include the action for creating a Property within the select.