Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Manage Properties and Apartments

Premium
6 min read

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

AA
Ali Al Qahtani ✓ Link copied!

In app/Filament/Resources/ApartmentResource.php:

there is mistake one line => RelationManagers\PropertiesRelationManager::class,

should be => RelationManagers\PropertyRelationManager::class,

PK
Povilas Korop ✓ Link copied!

Thank you, dear Editor of our team :) Fixed now!

A
Alexey ✓ Link copied!

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.

PK
Povilas Korop ✓ Link copied!

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?

A
Alexey ✓ Link copied!

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? :)

PK
Povilas Korop ✓ Link copied!

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.

A
Alexey ✓ Link copied!

Yes, that's right, agree with you. Thanx

G
gosocialdev ✓ Link copied!

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!

M
Modestas ✓ Link copied!

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

D
Davery ✓ Link copied!

Sadly hasCombinedRelationManagerTabsWithForm is no longer an option in Filament v3.

DS
Dmytro Sakharuk ✓ Link copied!

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.

Forms\Components\Select::make('property_id')
->preload()
->required()
->searchable()
->relationship('property', 'name')
->createOptionForm([
//..
]),

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.