Troner
Troner
FFilament
Created by Troner on 6/7/2024 in #❓┊help
->hidden() on TextColumn not working with $record parameter
Hmm, I want a ToggleColumn where you can toggle "is_public" but only on some records
6 replies
FFilament
Created by Troner on 6/7/2024 in #❓┊help
->hidden() on TextColumn not working with $record parameter
Ok, thank you 👍
6 replies
FFilament
Created by Troner on 4/20/2024 in #❓┊help
My custom filament page is showing the wrong sidebar from different panel
Oh shit, now i know my mistake 🤦‍♂️, i commented out ->discoverPages and didn't add my page in ->pages([]). It works now, thanks for helping. Also i removed it from web.php
9 replies
FFilament
Created by Troner on 4/20/2024 in #❓┊help
My custom filament page is showing the wrong sidebar from different panel
i made a new page for testing with php artisan make:filament-page TestPage and selected the user panel and then register it in web.php with Route::get('test-page', \App\Filament\Pages\TestPage::class); and then i get the sidebar from the admin. Also i now use ->path('/') in UserPanelProvider
9 replies
FFilament
Created by Troner on 2/21/2024 in #❓┊help
getTabs() on custom page?
Thanks @ruddy it worked. For others: i also needed to add ->modifyQueryUsing($this->modifyQueryWithActiveTab(...)) to $table to make it work
6 replies
FFilament
Created by Mike on 2/15/2024 in #❓┊help
Form only resource?
you could hide the resource from the sidebar and then create a new navigation item that redirects directly to the edit page
3 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
Do you get an error if you create a new entry? for me i got an error when creating new entry but it stored in in the database anyway
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
Hmmm, so you dont get any erros right? Just the repeater isn't rendered on edit page?
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
Like my code with Resource, Models and Relations
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
can i see your code?
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
or maybe you have a another Select::make Entry for example that has a name of a another relation, then it doesnt work, that was also an issue for me
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
do you have all needed columns in protected $fillable?
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
i didnt know what exactly the cause was i had many diffrent errors along the way
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
`// EnergyResource
->schema([
Forms\Components\Repeater::make('energyNutritionalValues')
->relationship()
->schema([
Forms\Components\Select::make('nutritional_value_id')
->label('Nährwert')
->relationship('nutritionalValues', 'name')
->searchable()
->createOptionForm([
Forms\Components\TextInput::make('name'),
Forms\Components\TextInput::make('unit'),
])
->live(onBlur: true),
Forms\Components\TextInput::make('amount')
->disabled(fn (Get $get) => $get('nutritional_value_id') === null)
->suffix(function (Get $get) {
if ($get('nutritional_value_id') === null) {
return 'Einheit';
} else {
return NutritionalValue::where('id', $get('nutritional_value_id'))->first()->unit ?? '';
}
}),
]),
])

// Energy Model

class Energy extends Model
{
public function energyNutritionalValues()
{
return $this->hasMany(EnergyNutritionalValue::class);
}
}

// EnergyNutritionalValue Model

class EnergyNutritionalValue extends Pivot
{
protected $table = 'energy_nutritional_values';

public function energy()
{
return $this->belongsTo(Energy::class);
}

public function nutritionalValues()
{
return $this->belongsTo(NutritionalValue::class, 'nutritional_value_id', 'id');
}
}

// NutritionalValue Model

class NutritionalValue extends Model
{
protected $table = 'nutritional_values';

public function energies()
{
return $this->belongsToMany(Energy::class, 'energy_nutritional_values', 'nutritional_value_id', 'energy_id');
}
}
`// EnergyResource
->schema([
Forms\Components\Repeater::make('energyNutritionalValues')
->relationship()
->schema([
Forms\Components\Select::make('nutritional_value_id')
->label('Nährwert')
->relationship('nutritionalValues', 'name')
->searchable()
->createOptionForm([
Forms\Components\TextInput::make('name'),
Forms\Components\TextInput::make('unit'),
])
->live(onBlur: true),
Forms\Components\TextInput::make('amount')
->disabled(fn (Get $get) => $get('nutritional_value_id') === null)
->suffix(function (Get $get) {
if ($get('nutritional_value_id') === null) {
return 'Einheit';
} else {
return NutritionalValue::where('id', $get('nutritional_value_id'))->first()->unit ?? '';
}
}),
]),
])

// Energy Model

class Energy extends Model
{
public function energyNutritionalValues()
{
return $this->hasMany(EnergyNutritionalValue::class);
}
}

// EnergyNutritionalValue Model

class EnergyNutritionalValue extends Pivot
{
protected $table = 'energy_nutritional_values';

public function energy()
{
return $this->belongsTo(Energy::class);
}

public function nutritionalValues()
{
return $this->belongsTo(NutritionalValue::class, 'nutritional_value_id', 'id');
}
}

// NutritionalValue Model

class NutritionalValue extends Model
{
protected $table = 'nutritional_values';

public function energies()
{
return $this->belongsToMany(Energy::class, 'energy_nutritional_values', 'nutritional_value_id', 'energy_id');
}
}
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
i need some minutes
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
@Sam i fixed it for my case. i will create a minified code version to paste it here
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
@Sam i am looking for 1 hour straight now, haven't given up yet
31 replies
FFilament
Created by Nazgul on 2/13/2024 in #❓┊help
Repeater datas not showing on edit
@Sam i have the same problem, please tell me when you find a solution, i will do the same
31 replies
FFilament
Created by Skrypt on 7/31/2023 in #❓┊help
filament v3: file upload on custom page
Thank you guys i had the same problem
7 replies
FFilament
Created by Troner on 10/13/2023 in #❓┊help
Custom Page with URL parameters
Thanks alot! It is working 😀
5 replies