Gustave
Gustave
FFilament
Created by Gustave on 2/16/2024 in #❓┊help
How do I register a user on a tenant ?
Hi all ! I'm developing an application based on a tenant named "event". First of all, I'd like to make it clear that this is a not-for-profit application designed to manage our volunteers at cultural events. I would like to create a registration page that incorporates the tenant, for example like : www.myWonderfulFilamentApp/volunteers/register/{event} in order to retrieve the tenant and store it in the session. Then I would like to use the default (extended) filament register class to create the user and automaticaly assign the tenant to it. Could someone help me? I can't seem to bridge the gap between laravel's web.php file and filament's register method in order to register a user according to the tenant given as a request parameter. Maybe there is a better solution ? thank you for your advice !
2 replies
FFilament
Created by Gustave on 1/10/2024 in #❓┊help
No Index, only EditRecord with RelationManager
Hi all, Each user of my application has a "HasOne" relationship to a model called Volunteer. I'd like to make a page a bit like MyProfile BUT, I need to have a RelationManager on this page and I can't see how to do it other than on a resource one. So how can I create a resource that has no index and only an Edit page that points to auth()->user() ? Thank you for your advice
4 replies
FFilament
Created by Gustave on 12/1/2023 in #❓┊help
Form validation in Livewire component
Hi guys, I have a form in a Livewire component with a simple textInput. I don't know why but some Validations work (emai, required,...) but several others are ignored (alpha, filled, regex, etc...) I have the impression that the validations that work are basic html validations, but I don't know how to make the rest work. thanks for your help
3 replies
FFilament
Created by Gustave on 9/6/2023 in #❓┊help
Issue with nested TextColumn on Polymorphic relation
Hi folks, I try to display a TextColumn with a nested relation inside. With a simple relation like : public function assignee() { return $this->belongsTo(User::class); } ... Tables\Columns\TextColumn::make('assignee.initials') It works ! but when the relation is polymorphic : public function owner() { return $this->morphTo('ownerable'); } Tables\Columns\TextColumn::make('owner') will display the owner object and it's ok but Tables\Columns\TextColumn::make('owner.initials') will result in empty cells. Someone can give me some help ?
2 replies
FFilament
Created by Gustave on 8/23/2023 in #❓┊help
Custom Table footer in v3
Hi guys ! If I understand correctly, it's no more feasible to design a custom footer as on https://v2.filamentphp.com/tricks/aggregate-data-in-table-footer ? we are limitated to summarize which only accept queries right ?
8 replies
FFilament
Created by Gustave on 8/16/2023 in #❓┊help
issue with hiddenOn on Table Filter
Hi all, I have an issue with hiddenOn on Table Filter which seems to not working for me. On my resource table I have : ->filters([ Tables\Filters\Filter::make('only_top_level_teams') ->query(fn (Builder $query): Builder => $query->where('parent_team_id', null)) ->default() ->hiddenOn(SubTeamsRelationManager::class) ]) On the resource page : public static function getRelations(): array { return [ RelationGroup::make('Contacts', [ RelationManagers\SubTeamsRelationManager::class, RelationManagers\TimeslotsRelationManager::class, ]), ]; } On the relation page : class SubTeamsRelationManager extends RelationManager { protected static string $relationship = 'sub_teams'; public function form(Form $form): Form { return TeamResource::form($form); } public function table(Table $table): Table { return TeamResource::table($table); } } Anyone figured out why ? thx
4 replies
FFilament
Created by Gustave on 4/14/2023 in #❓┊help
Action modal Width
1 replies
FFilament
Created by Gustave on 4/7/2023 in #❓┊help
use $record in badgeColumn visibility
Hi all ! It's not possible to do this in a table ? I've got an error that $record is null : Tables\Columns\BadgeColumn::make('status.human_name') ->label(__('Status')) ->visible(fn ($record) => $record->is_internal), Thx
3 replies
FFilament
Created by Gustave on 3/29/2023 in #❓┊help
MorphToSelect in Repeater (Mdue to MorphMany)
Hi all ! I'm trying to develop a planning tool where I've Tasks (or Milestones) and each may have dependencies (predecessors or successors) which are also Tasks (or Milestones). To do that, both models extends an 'Activity' class where we can find the following relation : public function predecessors() { return $this->morphMany(Dependency::class, 'successor'); } In the Dependency class, I retrieve the model by a morphTo relation : public function successor() { return $this->morphTo(); } So now I try to deals with a form Modal (I'm already in relationManager) using Repeater (for the MorphMany relation) then a MorphToSelect (for the morphOne). I tried several things but for me the most relevant would be : Forms\Components\Repeater::make('predecessors') ->relationship() ->schema([ Forms\Components\MorphToSelect::make('successor') ->types([ Forms\Components\MorphToSelect\Type::make(Milestone::class)->titleColumnName('name'), Forms\Components\MorphToSelect\Type::make(Task::class)->titleColumnName('name'), ]), But this gives an error : Call to undefined method App\Models\Task::successor() I thought I had understood that inside the repeater I was dealing with the relationship of the predecessors, not the record, but I was obviously wrong. Could someone point me in the right direction? regards
1 replies
FFilament
Created by Gustave on 3/7/2023 in #❓┊help
TextInput unique w/o softDelete
Hi all ! Is there an elegant way to test that a TextInput is unique in the database by ignoring softDeletes? Regards
17 replies