Log1x
Sort resource by relationship count – exception when empty
I have
Developers
that own Software
and I'm currently using $table->defaultSort('software_count', 'desc')
to sort my developers by the amount of software they have on my DeveloperResource
.
If a developer does not have any software, I get an SQL exception for Unknown column 'software_count' in 'order clause'
Is there any way around that? It's just a simple HasMany
relationship.
I get this same issue with Tables\Columns\TextColumn::make('software_count')
but I think I can maybe do a hidden()
conditional check on it or something – but I also feel like I might be missing something. Ideally it'd just default to 0.5 replies
Using $panel->profile() with normal Page
is there a good way to extend the
EditProfile
page to bring it into a normal panel page layout? id like to use the ->profile()
panel functionality but I get screamed at over route stuff if I pass a normal Page to it and EditProfile its self has some goodies in it for handling saving, etc. so I kind of want to use it. mainly just have too much user profile data to make it look good on the SimplePage layout so getting kind of trolled 😩7 replies