Chrispian
Chrispian
FFilament
Created by José on 6/19/2024 in #❓┊help
Class "Filament\Forms\Components\SpatieTagsInput" not found
Make sure you imported the class at the top?
3 replies
FFilament
Created by informer on 6/15/2024 in #❓┊help
Am i following good practices?
FYI, you can post longer code as a gist on your GitHub and just provide the link.
14 replies
FFilament
Created by Pekempy on 6/15/2024 in #❓┊help
Overriding the Notification Panel
Could possibly solve with an observer + query scopes.
6 replies
FFilament
Created by hosmar27 on 6/13/2024 in #❓┊help
Is there any problem if I delete a relation manager just by deleting the created file? Could this co
Good find! Thanks for sharing that you found it. I’ve done that so many times lol
11 replies
FFilament
Created by hosmar27 on 6/13/2024 in #❓┊help
Is there any problem if I delete a relation manager just by deleting the created file? Could this co
Many to many is a little tricker for sure. If you can post more of the code I'd be happy to take a look if you don't solve it first.
11 replies
FFilament
Created by Sayy on 6/13/2024 in #❓┊help
how to get data relationship from table text column in description
Description supports callbacks. There is an example in the docs, just reference the relationship on your model as normal within the callback. Assuming the relationship name is stock and you want to show the stock's description:
TextColumn::make('productItems.stock')
->description(fn (YourModel $record): string => $record->stock->description)
TextColumn::make('productItems.stock')
->description(fn (YourModel $record): string => $record->stock->description)
https://filamentphp.com/docs/3.x/tables/columns/text#displaying-a-description You may have to tweak for your use case but this is what I think you're looking for.
10 replies
FFilament
Created by Asmit Nepali on 6/13/2024 in #❓┊help
Action failed notification.
This is UNTESTED but should get you in the ballpark I would think.
Action::make('delete')
->requiresConfirmation()
->action(function (YourModel $record) {
try {
$record->delete();
} catch (\Exception $e) {
Notification::make('exception', ['message' => $e->getMessage()])->send();
$this->halt();
}
})
Action::make('delete')
->requiresConfirmation()
->action(function (YourModel $record) {
try {
$record->delete();
} catch (\Exception $e) {
Notification::make('exception', ['message' => $e->getMessage()])->send();
$this->halt();
}
})
See if you can get the exception that way and then you can make the notification nicer if needed.
9 replies
FFilament
Created by Kitty on 6/13/2024 in #❓┊help
Problem with afterStateHydrated
Have you tried ‘$this-form()->mount()’? This has helped in similar situations.
11 replies
FFilament
Created by hosmar27 on 6/13/2024 in #❓┊help
Is there any problem if I delete a relation manager just by deleting the created file? Could this co
Probably not related. If this should be a unique value you should make it unique in your database. Just make a new migration and add the unique to it. Laravel has good docs on that if you don’t already know how. Also, you can add ->unique() to your input and Filament will also check. For unique IDs I recommend doing both.
11 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
Probably something really stupid lol
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
"Right way" lol. Never heard of it 😉
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
Nice! Looks good. I see the sorting issue. I'm betting since it's a modified query + a LW component something needs to be done around that to make it update the table data.
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
I'm gonna stew on this some more. I'm invested now lol.
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
Can you post the UserResource code?
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
Since this was a closure, I had to pass it in.
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
Ah, right. So in UserResource you should have access directly to $record. I'm using it like that in some of mine, eg: Forms\Components\Textarea::make('errors') ->formatStateUsing(function ( $record ) { return str_replace( ",", PHP_EOL, $record->errors ); })
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
So you added the mount method to the class ListAssets file? Try removing mount and just doing public Model $record; . But thinking about that, it just makes it available to the livewire component. I assume you want to pass it into the query?
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
haha. I always do!
92 replies
FFilament
Created by snipe on 6/12/2024 in #❓┊help
Tabbed container with infolist in one tab, other related tables in the other tabs
And speaking of n00b, learning filament has been a humbling experience lol. I don't know where Livewire ends and Laravel begins, not to mention Alpine. I'm loving it now that I know it a lot better but I'm still trying to learn it much deeper.
92 replies