Mehmet K.
Mehmet K.
FFilament
Created by Mehmet K. on 1/13/2025 in #❓┊help
Is it possible to drag and drop in Navigation Menus?
No description
9 replies
FFilament
Created by Mehmet K. on 1/13/2025 in #❓┊help
How to Build a Drag-and-Drop Navigation Menu in Filament without Third-Party Packages?
Hi everyone, I'm working on a Laravel Filament project, and I want to create a drag-and-drop navigation menu management system directly within the admin panel without relying on third-party packages like filament-navigation. Here's what I aim to achieve: Dynamically manage menu items with parent-child relationships. Allow sorting of menu items using a drag-and-drop interface. Save the updated menu order to the database. I've already considered using Sortable.js for the frontend drag-and-drop functionality, but I'm unsure about the best practices for integrating this into Filament, especially for handling hierarchical menu structures (nested menus). If anyone has experience or suggestions on how to implement this, or can provide a starting point for the migration, model relationships, or Filament resources, I’d greatly appreciate it!
2 replies
FFilament
Created by Mehmet K. on 12/6/2024 in #❓┊help
Filament Table Filtering: Summarizing Data by Year in Separate Rows
I want to apply a filter to my Filament table. My goal is to create a separate row for each year as a result of the filtering, and summarize the data for that year in each row. For example, I want to obtain a result like this after filtering:
year | sales_count | total_amount | date_of_sales | order_ids
2024 | 123 | 18284.00 | 2024-10-10 00:00:00| 28,29,34,38,39,...,180
2023 | 85 | 12500.00 | 2023-11-15 00:00:00| 1,2,3,4,5,...,90
2022 | 102 | 15000.00 | 2022-09-20 00:00:00| 91,92,93,94,...,195
year | sales_count | total_amount | date_of_sales | order_ids
2024 | 123 | 18284.00 | 2024-10-10 00:00:00| 28,29,34,38,39,...,180
2023 | 85 | 12500.00 | 2023-11-15 00:00:00| 1,2,3,4,5,...,90
2022 | 102 | 15000.00 | 2022-09-20 00:00:00| 91,92,93,94,...,195
For filtering, I'm using the following code: php
Tables\Filters\SelectFilter::make('week')->options([
'Saatlik' => 'Saatlik',
'Günlük' => 'Günlük',
'Haftalık' => 'Haftalık',
'Aylık' => 'Aylık',
'Yıllık' => 'Yıllık',
])->query(function (Builder $query, array $data): Builder {
$type = $data['value'];

if ($type === "Yıllık") {
$query->selectRaw('
YEAR(date_of_sales) as year,
COUNT(*) as sales_count,
SUM(order_total_amount) as total_amount,
MAX(date_of_sales) as date_of_sales,
GROUP_CONCAT(id) as order_ids
')
->whereNull('deleted_at')
->whereNotNull('date_of_sales')
->groupBy(DB::raw('YEAR(date_of_sales)'))
->orderBy(DB::raw('YEAR(date_of_sales)'), 'desc');
}

return $query;
}),
Tables\Filters\SelectFilter::make('week')->options([
'Saatlik' => 'Saatlik',
'Günlük' => 'Günlük',
'Haftalık' => 'Haftalık',
'Aylık' => 'Aylık',
'Yıllık' => 'Yıllık',
])->query(function (Builder $query, array $data): Builder {
$type = $data['value'];

if ($type === "Yıllık") {
$query->selectRaw('
YEAR(date_of_sales) as year,
COUNT(*) as sales_count,
SUM(order_total_amount) as total_amount,
MAX(date_of_sales) as date_of_sales,
GROUP_CONCAT(id) as order_ids
')
->whereNull('deleted_at')
->whereNotNull('date_of_sales')
->groupBy(DB::raw('YEAR(date_of_sales)'))
->orderBy(DB::raw('YEAR(date_of_sales)'), 'desc');
}

return $query;
}),


However, this code doesn't give me the desired result. All records are returned as a result of the filtering, and a separate row is not created for each year. My questions are: What changes do I need to make in the filtering code? What steps should I follow to create a separate row for each year and summarize the data for that year? How can I display the data obtained from the query result in the Filament table? Thank you in advance for your help. Best regards.
1 replies
FFilament
Created by Mehmet K. on 11/3/2024 in #❓┊help
Repeater is not working in custom modal form.
I define a custom modal form in my table, I define a form for it and establish the hasmany relationship, but when I open the form, the repeater comes empty. How can I solve this, what do you suggest? Tables\Columns\TextColumn::make('relation_order_id') ->label(function () { return new HtmlString("<span style='color: #0e82fc;'>İlişkili Kayıt No</span>"); }) ->sortable() ->getStateUsing(function ($record) { return new HtmlString("<span style='color: #111192; font-size: 14px; font-weight: bold;'>{$record->relation_order_id}</span>"); }) ->searchable() ->action( Action::make('openForm') ->form([ Repeater::make('qualifications') ->relationship() ->schema([ // ... ]) )] ->label('Detayları Göster')
->modalWidth('7xl') ) ->toggleable(),
1 replies
FFilament
Created by Mehmet K. on 10/23/2024 in #❓┊help
Custom Modal form closes as soon as I click on it.
What could be the reason why the modal form I made as a custom with my codes I shot as a video closes automatically when I switch to the side tab?
11 replies
FFilament
Created by Mehmet K. on 10/21/2024 in #❓┊help
My Bulkaction buttons do not fit in the table, can we add scroll?
No description
12 replies
FFilament
Created by Mehmet K. on 10/17/2024 in #❓┊help
Can Bulkaction buttons remain visible without being selected?
No description
5 replies
FFilament
Created by Mehmet K. on 10/15/2024 in #❓┊help
How can I save data in custom modal?
Action::make('customModal')
->label('Custom Modal')
->action(fn ($record, $set) => $set('record', $record)) // Custom action
->modalHeading('Custom Modal Başlığı')
->modalContent(function ($record) {

return view('filament.pages.test_modal', ['record' => $record]);
})
)
Action::make('customModal')
->label('Custom Modal')
->action(fn ($record, $set) => $set('record', $record)) // Custom action
->modalHeading('Custom Modal Başlığı')
->modalContent(function ($record) {

return view('filament.pages.test_modal', ['record' => $record]);
})
)
I send my own record data here, I made changes, for example, how do I save them?
7 replies
FFilament
Created by Mehmet K. on 10/15/2024 in #❓┊help
Can we show a table in the tabs inside the modal form?
No description
4 replies
FFilament
Created by Mehmet K. on 10/14/2024 in #❓┊help
Is it Possible to Open a Modal within Another Modal in Laravel Filament?
Hello Filament Community, I am working on a project using Laravel Filament, and I came across a situation where I need to open a second modal inside an already opened modal. In other words, I want the user to be able to trigger a second modal from within the first modal and have both modals function independently of each other. What I am trying to achieve: Open a primary modal form. Place a button inside the primary modal. When the button is clicked, it should open another modal (secondary modal) inside the first one. I am curious if Filament natively supports opening nested modals. If not, what would be the best way to achieve this, or any recommended workarounds? Solutions I've Tried: Using Livewire to Trigger Modals: I created both modals as Livewire components and tried to use JavaScript to trigger the second modal via a button click inside the first one. I attempted to use Livewire.on() to open the second modal via JavaScript, but encountered issues with styling and focus management for the nested modals. Manually Handling the Modals with JavaScript: I tried manually opening the second modal by removing the Tailwind CSS classes (like hidden) to make it visible. However, this approach felt a bit messy and led to some complexity. My Questions: Does Filament support opening one modal inside another out of the box? If not, what would be the recommended way to implement this (for example, do I need to use JavaScript or Livewire customizations)? Has anyone faced a similar requirement, and how did you handle it? I would greatly appreciate any suggestions or guidance. Thank you in advance!
3 replies
FFilament
Created by Mehmet K. on 10/9/2024 in #❓┊help
Form Data is Not Saved When I Click the Print Button: How Do I Fix It?
No description
5 replies
FFilament
Created by Mehmet K. on 10/8/2024 in #❓┊help
Adding a Default Action Modal Button Next to a Column in Filament Table
No description
5 replies
FFilament
Created by Mehmet K. on 10/8/2024 in #❓┊help
Can we change the titles of these columns in the table?
No description
9 replies
FFilament
Created by Mehmet K. on 10/8/2024 in #❓┊help
How do I do Print in Bulkaction?
For certain columns of my selected records, I need to take a print action with a note on each page, but how can I do it?
14 replies
FFilament
Created by Mehmet K. on 10/3/2024 in #❓┊help
404 errror and Post request to livewire/update Import csv
No description
3 replies
FFilament
Created by Mehmet K. on 10/3/2024 in #❓┊help
I stay in 404 after admin login, how can I solve it?
No description
2 replies
FFilament
Created by Mehmet K. on 10/1/2024 in #❓┊help
Can I change the language of a package without a language file?
No description
3 replies
FFilament
Created by Mehmet K. on 9/27/2024 in #❓┊help
I get the error filament import does not exist.
No description
2 replies
FFilament
Created by Mehmet K. on 9/26/2024 in #❓┊help
How to add an interactive map in Filament?
No description
1 replies
FFilament
Created by Mehmet K. on 9/17/2024 in #❓┊help
"Menu Item Not Showing in Filament FranchisePanelProvider"
No description
3 replies