Randak
Randak
FFilament
Created by Randak on 2/17/2025 in #❓┊help
Action to redirect from one panel to another
My Admin Panel lists a User's current nebula_instances. When I click on a specific nebula_instance I want to redirect to the game panel and retain the nebula_instance_id. I've tried many ways (some versions in Pastebin commented out), but can't get it to work. My current error when clicking a nebula_instance is: foreach() argument must be of type array|object, string given Any guidance, direction, an open source project that does this, would be appreciated. I am a coding novice. Thanks. Pastebin for the full files: https://pastebin.com/W5fsJXic#hJGUz6WJ Some select file info that hopefully provides the answer: Standard panels (no dashboard): Admin Game From the NebulaInstanceResource:
->actions([
Action::make('viewGame')
->label('Enter Game')
->icon('heroicon-o-play')
// ->action(function (NebulaInstance $record) {
// session(['nebula_instance_id' => $record->id]);
// return redirect('/game');
// }),

->url('/game')
//->url(fn (NebulaInstance $record) => url('/game?nebula_instance_id=' . $record->id))
->openUrlInNewTab()
])
->actions([
Action::make('viewGame')
->label('Enter Game')
->icon('heroicon-o-play')
// ->action(function (NebulaInstance $record) {
// session(['nebula_instance_id' => $record->id]);
// return redirect('/game');
// }),

->url('/game')
//->url(fn (NebulaInstance $record) => url('/game?nebula_instance_id=' . $record->id))
->openUrlInNewTab()
])
33 replies
FFilament
Created by Randak on 1/7/2025 in #❓┊help
Dropdown with more than 50 records
Novice user. I have a dropdown for my create and edit forms that have about 70 records. I want the whole list to be available to the user. How can I increase this limit?
->headerActions([
Tables\Actions\AttachAction::make()
->preloadRecordSelect()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\TextInput::make('fame_points')
->required()
->integer(),
]),
])
->headerActions([
Tables\Actions\AttachAction::make()
->preloadRecordSelect()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\TextInput::make('fame_points')
->required()
->integer(),
]),
])
5 replies
FFilament
Created by Randak on 6/9/2024 in #❓┊help
Editing a many-to-many attachment with pivot attributes.
I have a Creature and Shield model with a CreatureShield pivot table. The belongsToMany relationship is defined in both Models. I can attach and detach from the Creature model, including adding pivot table fields for new attachments. When I try to edit an existing attachment I get this error: Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in /var/www/html/vendor/filament/forms/src/Components/Select.php This is my first Laravel project and I'm a hobby coder so please excuse my lack of knowledge.
6 replies