shebaoting
shebaoting
FFilament
Created by shebaoting on 8/4/2024 in #❓┊help
How to Use mutateFormDataBeforeFill or mutateFormDataBeforeSave for Related Data in Relationships
I have two models, a Customer associated with multiple Contacts. When adding a Customer, I use Repeater::make('contacts')->relationship('contacts')->schema() to add related data. How can I use mutateFormDataBeforeFill or mutateFormDataBeforeSave for Contact data when creating and editing a Customer?
3 replies
FFilament
Created by shebaoting on 5/24/2024 in #❓┊help
Shield the plugin, how do I control the roles menu to only show up in one panel, but the permissions
I have 3 panels, admin, operation and customer, do I need to set this code for all 3 panels for the permissions to take effect? If I set this code in all 3 panels, it will result in the roles menu appearing on the left side of all 3 panels. I only want the roles menu to appear in the admin panel, but the permissions set are valid in all panels. What should I do?
2 replies
FFilament
Created by shebaoting on 5/23/2024 in #❓┊help
Users other than administrators cannot log in. What is the reason for this?
Users other than administrators cannot log in. What is the reason for this?
public function canAccessPanel(Panel $panel): bool
{
return true;
}
public function canAccessPanel(Panel $panel): bool
{
return true;
}
5 replies
FFilament
Created by shebaoting on 5/16/2024 in #❓┊help
Modal Blade component has a problem with Nesting Components
Package Other Package Version v3.0.0 How can we help you? parent component
@foreach ($opportunitys as $opportunity)
<livewire:company.opportunity.item :$opportunity :key="$opportunity->id" />
@endforeach
@foreach ($opportunitys as $opportunity)
<livewire:company.opportunity.item :$opportunity :key="$opportunity->id" />
@endforeach
child component
<x-filament::modal id="show-lost">

<form wire:submit="onLost">
<x-filament::button type="submit" class="float-right">保存</x-filament::button>
</form>
</x-filament::modal>
<x-filament::modal id="show-lost">

<form wire:submit="onLost">
<x-filament::button type="submit" class="float-right">保存</x-filament::button>
</form>
</x-filament::modal>
class Item extends Component
{
public $opportunity;
public $opportunityId;
public function render()
{
return view('livewire.company.opportunity.item');
}


public function showLost($id){
$this->opportunityId = $id;
$this->dispatch('open-modal', id: 'show-lost');
}

public function onLost()
{
dd($this->opportunityId);
}

}
class Item extends Component
{
public $opportunity;
public $opportunityId;
public function render()
{
return view('livewire.company.opportunity.item');
}


public function showLost($id){
$this->opportunityId = $id;
$this->dispatch('open-modal', id: 'show-lost');
}

public function onLost()
{
dd($this->opportunityId);
}

}
In showLost(), the value of $this->opportunityId is available, but the value of $this->opportunityId is not available in onLost(), it is null If Nesting Components is not used. then everything is fine. May I ask how this problem can be solved? Is it a bug?
2 replies
FFilament
Created by shebaoting on 10/19/2023 in #❓┊help
Which is a better extension for permission control?
althinect/filament-spatie-roles-permissions and chiiya/filament-access-control Which is better?
6 replies