phydeaux
phydeaux
FFilament
Created by phydeaux on 11/1/2024 in #❓┊help
Repeater - deletable except for first item
Geez! How did I miss that? Thanks
6 replies
FFilament
Created by phydeaux on 10/18/2024 in #❓┊help
Change repeater field label based on other field value
If anyone else needs something like this, I was able to pass in the $livewire object instead of $get. Then you can evaluate $livewire->data['fieldname'] within the closure.
4 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
D'oh! I mentally glossed over the part where you were trying to use the component object. Sorry for that irrelevant wild goose chase. (facepalm) I may make that change when I pick that project back up. It's not my active one at the moment. But it's working for now.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
bootstrap/providers.php
return [
App\Providers\AppServiceProvider::class,
App\Providers\ConfigurationServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
];
return [
App\Providers\AppServiceProvider::class,
App\Providers\ConfigurationServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
];
app/Providers/ConfigurationServiceProvider.php
namespace App\Providers;

use Filament\Forms\Components\RichEditor;
use Filament\Panel;
use Illuminate\Support\ServiceProvider;

class ConfigurationServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
// Define the logos here rather than in every panel
Panel::configureUsing(function (Panel $panel) {
return $panel
->brandLogo(asset('img/hrlink-logo.svg'))
->darkModeBrandLogo(asset('img/hrlink-logo-light.svg'));
});
}

/**
* Bootstrap services.
*/
public function boot(): void
{
RichEditor::configureUsing(function (RichEditor $richEditor) {
return $richEditor
->columnSpanFull()

/* Available toolbar buttons:
'bold', 'italic', 'underline', 'link', 'h2', 'h3', 'undo', 'redo',
'attachFiles', 'blockquote', 'bulletList', 'codeBlock', 'orderedList', 'strike'
*/
->toolbarButtons([
'bold',
'italic',
'underline',
'link',
'undo',
'redo',
]);
});
}
}
namespace App\Providers;

use Filament\Forms\Components\RichEditor;
use Filament\Panel;
use Illuminate\Support\ServiceProvider;

class ConfigurationServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
// Define the logos here rather than in every panel
Panel::configureUsing(function (Panel $panel) {
return $panel
->brandLogo(asset('img/hrlink-logo.svg'))
->darkModeBrandLogo(asset('img/hrlink-logo-light.svg'));
});
}

/**
* Bootstrap services.
*/
public function boot(): void
{
RichEditor::configureUsing(function (RichEditor $richEditor) {
return $richEditor
->columnSpanFull()

/* Available toolbar buttons:
'bold', 'italic', 'underline', 'link', 'h2', 'h3', 'undo', 'redo',
'attachFiles', 'blockquote', 'bulletList', 'codeBlock', 'orderedList', 'strike'
*/
->toolbarButtons([
'bold',
'italic',
'underline',
'link',
'undo',
'redo',
]);
});
}
}
In this app, the RichEditor config works great. But the logo change wasn't happening when it was in boot(). Moved it to register(0 and it worked fine.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
It's not open source or posted anywhere but I can share the config stuff. It's pretty basic, though. I'll pop it up here in just a sec.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
All I needed to do was move from boot() to register() and magic happened
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
According to the docs, you can also put global configureUsing() in a middleware. I've never tried that but it's worth a shot
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
(Note: I'm not a Filament pro by any stretch.)
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
Yeah, it needs to be in bootstrap/providers.php.
I haven't seen it where one of those wouldn't do the trick. If it's still not working, my next try would be to throw some debug lines (log, dd, ray, whatev) into the main method and also into the configureUsing closure to verify if it's actually getting called or not.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
Sometimes boot() works fine but sometimes that gets hit too soon and register() works better.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
The PanelProvider that gets made using the artisan commands don't put it there by default but any ServiceProvider can have a register() method since they all ultimately should be extending Illuminate\Support\ServiceProvider. If it's not there, just add it. And those things can be in any ServiceProvider. For maintenance simplicity, I created a generic ConfigurationServiceProvider (basic Laravel - nothing Filament specific) and put all my global configureUsing items in there.
23 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
I had a similar issue a while back. Try putting it in the register() function instead.
23 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
That makes sense, thanks
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
And that worked great, btw
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
Okay, cool. Thanks. I didn't think that was an issue since I was able to access it inside a Split >> Section >> Placeholder structure. Anyway, It's something to try next time I run up against it.
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
Ah, so Get is scoped to the layout component? Good to know.
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
Maybe what I'm trying to do isn't possible then. The way I understand it is that relationship() on the Select is used to populate the options and then save that relation to the primary model and relationship() on the layout components is for saving fields to relationships. In my case, the relationship on the Grid is there to have a place to (optionally) save the value if one is selected - an override of the default value currently assigned - but the select list options are coming from an entirely different model. I'm pulling those options in just fine. What I'm trying to do is to filter out the selected code as well as the currently assigned manager from the list since the override value can't be either of those.
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
I appreciate the suggestion. Sadly, no joy. Same result. Or rather same lack of result.
18 replies
FFilament
Created by phydeaux on 8/12/2024 in #❓┊help
Live select field not found with $get
Also, if I dd($get) at the point of the log line, I have a Get object with only one component, the current select field itself.
18 replies
FFilament
Created by phydeaux on 8/6/2024 in #❓┊help
Does configureUsing work on Filament\Panel?
Winner winner! That was it. I feel stupid that that didn't occur to me. Really appreciate the help.
8 replies