MikePageDev
MikePageDev
FFilament
Created by MikePageDev on 4/4/2025 in #❓┊help
Repeater HasMany
I have followed the docs regarding the BelongsToMany relationship. I have managed to get this to work on a custom page, but now I am trying to add it to a Resource. The edit page is not displaying existing relationships, and Create and Edit are not saving new relationships to the pivot table. My pivot table does have an incremental id column. Here is my repeater code
Repeater::make('federationOpponent')
->columns(1)
->model(Opponent::class)
->relationship('federationOpponent')
->schema([
Select::make('federation_id')
->relationship('federation', 'tag')
->required()
->distinct(),
TextInput::make('federation_code')
->required(),
])
->addActionLabel('Add Federation')
Repeater::make('federationOpponent')
->columns(1)
->model(Opponent::class)
->relationship('federationOpponent')
->schema([
Select::make('federation_id')
->relationship('federation', 'tag')
->required()
->distinct(),
TextInput::make('federation_code')
->required(),
])
->addActionLabel('Add Federation')
Here are my model relationships
class Opponent extends Model
{
public function federationOpponent(): HasMany
{
return $this->hasMany(FederationOpponent::class, 'opponent_id');
}
}

class FederationOpponent extends Pivot
{
protected $table = 'federation_opponent';
protected $fillable = ['federation_id', 'opponent_id', 'federation_code'];

public function federation(): BelongsTo
{
return $this->belongsTo(Federation::class);
}

public function opponent(): BelongsTo
{
return $this->belongsTo(Opponent::class);
}
}
class Opponent extends Model
{
public function federationOpponent(): HasMany
{
return $this->hasMany(FederationOpponent::class, 'opponent_id');
}
}

class FederationOpponent extends Pivot
{
protected $table = 'federation_opponent';
protected $fillable = ['federation_id', 'opponent_id', 'federation_code'];

public function federation(): BelongsTo
{
return $this->belongsTo(Federation::class);
}

public function opponent(): BelongsTo
{
return $this->belongsTo(Opponent::class);
}
}
Any ideas? Have I missed something?
6 replies
FFilament
Created by MikePageDev on 7/2/2024 in #❓┊help
Adding percentages to pie chart
No description
17 replies
FFilament
Created by MikePageDev on 3/5/2024 in #❓┊help
Add an Edit button in a view page
Is there a way to add an Edit button yo a view page?
4 replies
FFilament
Created by MikePageDev on 2/26/2024 in #❓┊help
Row actions in relationship manager not doing anything
I have the folowing in my table method
->actions([
Table\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
])
->actions([
Table\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
])
but when I click on the buttons nothing hapens. Any ideas on what might be happerning?
47 replies
FFilament
Created by MikePageDev on 1/2/2024 in #❓┊help
Dynamic hint not updating
Hi I have a hint on a field that changes depending on a select field. I have this working in another app but cant seem to get it working in this one and for the life of me I cant figure out what I have done differently. here is a code example
use Filament\Forms\Get;

Select::make('selection')
->relationship('selection', 'tag',)
->preload()
->searchable()
->columnSpan(2),
TextInput::make('text_input')
->hint(function (Get $get) {
return $get($selection) ? '' : 'no selection';
})
->maxLength(255)
->columnSpan(2),
use Filament\Forms\Get;

Select::make('selection')
->relationship('selection', 'tag',)
->preload()
->searchable()
->columnSpan(2),
TextInput::make('text_input')
->hint(function (Get $get) {
return $get($selection) ? '' : 'no selection';
})
->maxLength(255)
->columnSpan(2),
For some reason the hint is not changing when an option is selected.
6 replies
FFilament
Created by MikePageDev on 11/10/2023 in #❓┊help
Using JS package in custom widget
I am trying to create a widget with a chessboard using chessboardjs. I have tried retesting the js and css using FilamenAsst::register() and flowed the instructions in the docs but I just get a Failed to open stream: No such file or directory error. Sorry I know this must be simple to do. Thanks
19 replies
FFilament
Created by MikePageDev on 10/11/2023 in #❓┊help
leandrocfe/filament-apex-charts add custom tooltips
Hi is there anyone familer with this plugin that could explain to me how to add custom tooltips to a pie chart, please?
3 replies
FFilament
Created by MikePageDev on 9/15/2023 in #❓┊help
Stop New Password field auto-filling
Just a quick question. I am on v3 and have a custom profile form. How do I stop the new password field auto- filling with the existing password?
4 replies
FFilament
Created by MikePageDev on 6/22/2023 in #❓┊help
Use tailwind in custom column
Hi I have got a bit confused how to use tailwind with in a custom column
<div>
<span class="text-green-500">{{$getRecord()->wins}}</span>
</div>
<div>
<span class="text-green-500">{{$getRecord()->wins}}</span>
</div>
the column works fin apart from the colour. I plan on using 2 different colours in the column. What am I missing?
5 replies
FFilament
Created by MikePageDev on 6/7/2023 in #❓┊help
Add new parent in select field
Hi, I have a one to many relationship, in the child create form I have a select field. Is it possible to create a new parent if it does not exist without changing view? Or would I need to create a custom field?
10 replies
FFilament
Created by MikePageDev on 5/12/2023 in #❓┊help
Missing required parameter for [Route: filament.resources.users.edit] after Customising the account
Hi. I am new to Filament. I have followed the docs to customise the account link in the user menu. I refreshed my app while logged in and all seem to work nicely. I then logged out to test with another account and I get the following error https://flareapp.io/share/47qrnQx5#F55
9 replies