cakan
Refresh repeater from child field
I have a Repeater that displays a list of documents. Each document is represented as a custom section with it's own delete button.
But when I delete a record, repeater doesn't refresh. How do I refresh repeater from the child component?
This is what I have tried but with no luck.
When I add new document, repeater refreshes. But when I delete it, it remains in the Repeater.
12 replies
DeleteAction throws error on custom header
I have created a custom header for my page and added this code to the header:
Code for my page looks like this:
What I want to achieve is to have Delete button on viewPage header. But I keep getting error saying
"Filament\Actions\DeleteAction::Filament\Actions{closure}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given, called in \vendor\filament\support\src\Concerns\EvaluatesClosures.php on line 35"
If I put regular Action or EditAction instead of DeleteAction, it works as expected, What am I missing?
4 replies
Filament login using API
I want to use filament for my project without database. Instead, it will use external API to fetch the data. I know that I can use Sushi library to work with data models.
What I don't know how to do is login user using external API. I've managed to make the login work with Sushi, but I can't use
Filament::auth()->attempt()
.
I have extended authenticate method of Filament login page with this code:
This partially works but guards don't work any more. What is the correct way of doing this?3 replies
TextEntry url
I have a custom page and it displays Infolist with some TextEntries. In my custom page I have this code:
So there is a company model which can have multiple files. This will display a list of all files. But I want to be able to have file name displayed to be clickable and link to a file. Issue is that in database (files.path) is stored only a filename. In order to have full url, I must do
asset('storage/'. $filenameFromDB)
. How can I do that?3 replies
Refresh tab badge
Is it possible to refresh a tab badge?
I have Infolist which displays data in tabs. One of the tabs has a badge which displays number of users and a list of users. If I delete a user from the list, badge will still display old count of users. Is it possible to refresh the badge value or to somehow make it reactive?
My tab is defined like this:
2 replies
Action not working in custom view
I have a custom page with action defined like this:
In blade for my custom view I have this line
This works as expected and clicking on a button starts file download.
Later, on same custom page I have a modal dialog with Book details this modal uses another custom view:
But here the action defined in my custom page doesn't work. Code recognizes the downloadBookAction and the button is displayed with all formatting, icon, etc. but when I click on the button, nothing happens - it never gets into the
->action()
method.
What am I doing wrong?2 replies
Widget with datepicker
I'm trying to make a widget that will be displayed on a Dashboard. Widget displays some statistics based on the selected date.
I've created a Widget with a form and added form to the layout, but I'm having trouble how to get date from the form and pass it to my report function.
This is my code:
View is just displaying the form and the data received from
getMonthlyReports
function.
How do I pass the date value from form to the getMonthlyReports
function and refresh the widget?12 replies
Tabs with different content
Hello,
I'm new to Filament and I'm stuck with organizing resources. I hope someone can point me into right direction.
I have Company which has Users and Projects. I want to have one page that will have three tabs:
- 1st tab will display company details, address, etc.
- 2nd tab will display all users
- 3rd tab will display all projects
I created CompanyResource with following relations:
public static function getRelations(): array
{
return [
ProjectsRelationManager::class,
UsersRelationManager::class,
];
}
This works as expected - I get two tabs displaying tables. How can I add 1st tab which will display company details? Am I on the right path when doing it with relations? Can relation point to infolist instead of table? Or should I work with tab some other way?13 replies