nexxai
nexxai
FFilament
Created by nexxai on 12/20/2024 in #❓┊help
Unsure if plugin exists or how I'd do this if one doesn't
It seems to work fine.
5 replies
FFilament
Created by nexxai on 12/20/2024 in #❓┊help
Unsure if plugin exists or how I'd do this if one doesn't
Ok for anyone who ends up finding this in the future, I ended up making a middleware that checks if any of the fields are null (and that they're not currently trying to access the profile edit page), and if so, redirects them to the profile edit page.
5 replies
FFilament
Created by nexxai on 12/9/2024 in #❓┊help
Error when trying to sort table by MorphTo relationship
@awcodes I'm only tagging you here since you're a core maintainer of Filament and this actually seems like something that may be an issue with Filament, specifically with regards to whereHas calls. As per https://github.com/laravel/framework/pull/28928 (and linked from https://github.com/laravel/framework/issues/18523 which describes a similar - but technically not identical - issue) whereHas doesn't work on MorphTo relationships, and my assumption is that in the building of the table, it's doing a whereHas() call instead of the whereHasMorph() which was submitted in the linked PR.
I did a search through the entire filamentphp GitHub organization for the term "wherehasmorph" (https://github.com/search?q=org%3Afilamentphp+wherehasmorph&type=code) and got 0 results so it at least seems possible that Filament not checking for a morphable relationship and implementing the corresponding whereHas-type lookup could be the source of at least one issue. Do you have any suggestions about what I should do next? Is this something the team would even consider looking into? I feel like I'm not the first one who would ever be trying to do something like this, but my searching isn't turning up anything that could even lead me in a direction.
9 replies
FFilament
Created by nexxai on 12/9/2024 in #❓┊help
Error when trying to sort table by MorphTo relationship
Person model:
public function user(): MorphTo
{
return $this->morphTo();
}
public function user(): MorphTo
{
return $this->morphTo();
}
User model:
public function person(): MorphOne
{
return $this->morphOne(Person::class, 'user');
}
public function person(): MorphOne
{
return $this->morphOne(Person::class, 'user');
}
I've also tried with a straight hasOne relationship on the User model, and the same thing happens. Also of note, the table is being displayed on the PersonResource in Filament, so I'm not sure how I would fix the pluralization; it's not going user->person/people, it's going person->user When you say that I "deviate from the regular naming conventions", can you explain what you mean? Like I think you mean person vs. people, but I was always under the impression that the model should be titled the singular of the noun, and the table gets named as the plural. Did I do or assume something wrong here?
9 replies
FFilament
Created by nexxai on 12/9/2024 in #❓┊help
Error when trying to sort table by MorphTo relationship
Single bump
9 replies
FFilament
Created by nexxai on 12/9/2024 in #❓┊help
Error when trying to sort table by MorphTo relationship
More notes: - If I remove the defaultSort() on the name column but then try to sort the column manually by clicking on the chevron at the top of the column, the same error shows up - The same error also appears to affect another column on the same table which is also on the related model, strengthening my belief that it is somehow related to the MorphTo aspect of the relationship - Other columns which are not related are sortable just fine when the chevron is clicked
9 replies
FFilament
Created by nexxai on 10/30/2024 in #❓┊help
RichEditor - Is there a way to make it scrollable?
Fair enough. Will dig into it and see if it's a relatively easy thing to do. If so, will submit a PR. Otherwise, I'll just do the custom theme. Thanks for your help!
6 replies
FFilament
Created by nexxai on 10/30/2024 in #❓┊help
RichEditor - Is there a way to make it scrollable?
I wouldn't mind investing the time to make it an option if it would be considered.
6 replies
FFilament
Created by nexxai on 10/30/2024 in #❓┊help
RichEditor - Is there a way to make it scrollable?
Would a PR to make it configurable (obviously defaulting to the current behaviour) be considered?
6 replies