lukevi
lukevi
FFilament
Created by Soundmit on 10/16/2024 in #❓┊help
Avoid ID in edit page
Then create the relationship like Models\Frontend::hasMany('settings'). Sure the relationship may be unnecessary, but the benefit is the Filament repeater can work with it easily.
20 replies
FFilament
Created by Kaaiman on 10/18/2024 in #❓┊help
Dynamic default repeater fields
The repeater’s schema is just an array of form components- you can load your config and build your array dynamically before assigning it to the form schema.
4 replies
FFilament
Created by Soundmit on 10/16/2024 in #❓┊help
Avoid ID in edit page
In that case - a repeater could probably do what you want. If settings is a table, make it a relation to something like User, as in User::hasMany('settings'). Then the user/edit page can list every setting, available to edit, and save all with one submit.
20 replies
FFilament
Created by Soundmit on 10/16/2024 in #❓┊help
Avoid ID in edit page
20 replies
FFilament
Created by lukevi on 9/13/2024 in #❓┊help
External js on just one dialog
got the tag working by adapting a snippet from the alpine docs.
<div x-data="{
init() {
const head = document.getElementsByTagName('head')[0]

// add script
const newScript = document.createElement('script')
newScript.src = 'https://the-vendor.js'
newScript.setAttribute('data-api-key', '{{ config('the-api-key') }}')
head.appendChild(newScript)
}
}">
<div x-data="{
init() {
const head = document.getElementsByTagName('head')[0]

// add script
const newScript = document.createElement('script')
newScript.src = 'https://the-vendor.js'
newScript.setAttribute('data-api-key', '{{ config('the-api-key') }}')
head.appendChild(newScript)
}
}">
5 replies
FFilament
Created by lukevi on 9/13/2024 in #❓┊help
External js on just one dialog
looks like I just needed to read the docs more thoroughly re loading the file, and then take a lucky guess on passing the attribute:
<div x-data
x-load-js="[@js('https://the-vendor.js')]"
data-api-key="{{ config('the-api-key') }}"
<div x-data
x-load-js="[@js('https://the-vendor.js')]"
data-api-key="{{ config('the-api-key') }}"
edit: that guess wasn't so lucky - the resulting <script> tag did not end up with the necessary attribute
5 replies
FFilament
Created by lukevi on 6/21/2024 in #❓┊help
Column URL - apply only to text, not the whole cell?
Amazing- Filament has still not stopped impressing me with its flexibility. Thank you for another very helpful answer.
8 replies
FFilament
Created by lukevi on 6/21/2024 in #❓┊help
Column URL - apply only to text, not the whole cell?
it's a little tempting to fiddle with the column component - it looks like I could remove the $url from these checks and make the overall cell keep the row's behavior.
#/vendor/filament/tables/resources/views/components/columns/column.blade.php
@if (($url || ($recordUrl && $action === null)) && (! $isClickDisabled))
<a
{{ \Filament\Support\generate_href_html($url ?: $recordUrl, $shouldOpenUrlInNewTab) }}
class="{{ $columnClasses }}"
>
{{ $slot }}
</a>
#/vendor/filament/tables/resources/views/components/columns/column.blade.php
@if (($url || ($recordUrl && $action === null)) && (! $isClickDisabled))
<a
{{ \Filament\Support\generate_href_html($url ?: $recordUrl, $shouldOpenUrlInNewTab) }}
class="{{ $columnClasses }}"
>
{{ $slot }}
</a>
then i'd have to go into the specific types like text-column.blade.php and put an <a> around maybe {{ $placeholder }}..
8 replies
FFilament
Created by lukevi on 6/21/2024 in #❓┊help
Column URL - apply only to text, not the whole cell?
good suggestion, thanks! That will show on hover anywhere in the cell & help make the expected click behavior fit what will happen.
8 replies
FFilament
Created by abdullafahem on 5/6/2024 in #❓┊help
Filament Export Action
Also run well with non-filament route I can create/write that public dir.
ah sorry, I didn't see this part. also just noticed that you're instantly starting the download for the user - that is clever. I don't have any other good suggestions. One thing to try might be a more basic path with just A-Z?
10 replies
FFilament
Created by vahnmarty on 5/7/2024 in #❓┊help
Is there an easy way to transform all labels to a different format instead of ucfirst (default) ?
I have done this in my AppServiceProvider (Laravel 10 - not sure where you'd do it in 11):
// Labels like 'Head Line' not 'Head line':
// instead of adding to each individual Filament/PanelProvider
$overrideDefaultLabel = function ($o): void {
$o->label(
str($o->getName())
->beforeLast('.')
->afterLast('.')
->headline()
);
};

Column::configureUsing($overrideDefaultLabel);
Field::configureUsing($overrideDefaultLabel);
Action::configureUsing($overrideDefaultLabel);
// Labels like 'Head Line' not 'Head line':
// instead of adding to each individual Filament/PanelProvider
$overrideDefaultLabel = function ($o): void {
$o->label(
str($o->getName())
->beforeLast('.')
->afterLast('.')
->headline()
);
};

Column::configureUsing($overrideDefaultLabel);
Field::configureUsing($overrideDefaultLabel);
Action::configureUsing($overrideDefaultLabel);
5 replies
FFilament
Created by abdullafahem on 5/6/2024 in #❓┊help
Filament Export Action
right- I don't know the exact problem, but testing the same Storage() method in plain Laravel will surely narrow down where your issue is. My guess is it's in the plain Laravel side, not FIlament.
10 replies
FFilament
Created by abdullafahem on 5/6/2024 in #❓┊help
Filament Export Action
You might test in just a basic non-filament route whether you can create that dir & write a file there, using your same Storage disk. If you can't, that would point to your storage config..
10 replies
FFilament
Created by nowak on 4/3/2024 in #❓┊help
Why is this bad? Sending export completion notification to the UI as well as to the database.
Thanks for asking – they actually started working after I closed my browser and came back. Multiple hard refreshes had not worked.
6 replies
FFilament
Created by Jamie Cee on 3/25/2024 in #❓┊help
Export download prompt
I would prefer this too - my exports are not large enough to justify the backgrounding & db-notification requirements
27 replies
FFilament
Created by nowak on 4/3/2024 in #❓┊help
Why is this bad? Sending export completion notification to the UI as well as to the database.
thanks for sharing this - I don't yet have db-notifications working, so this is the only way I can see the completed exports. have you managed to implement this with an override outside of the vendors dir?
6 replies
FFilament
Created by johnllobrera on 4/18/2024 in #❓┊help
Is it possible for filament that I will show all the data in different panel? my foreign key is id.
you can add a table widget in the header or footer that lists the accruals
4 replies
FFilament
Created by Francisco García on 4/18/2024 in #❓┊help
Bulk action with relationship toggles
I think the way is on your BulkAction, add the action() method like so:
->action(function (Collection $selectedRecords, $livewire) {
$data = $livewire->getMountedTableBulkActionForm()->getState();
// .. your update code
})
->action(function (Collection $selectedRecords, $livewire) {
$data = $livewire->getMountedTableBulkActionForm()->getState();
// .. your update code
})
2 replies
FFilament
Created by Luiz on 3/14/2024 in #❓┊help
Is possible to create page with dynamic sub pages?
are the files listed in your db? the table view works best from a db query, so hopefully that's a yes. I believe you could set your table row-click action to update the filter. When the row type is a subfolder, you'd update the filter to ->where('path', $newSelectedPath)
3 replies
FFilament
Created by lukevi on 8/31/2023 in #❓┊help
Set all column titles to headline()
Tacking on to my own old question since I've wound up adding the same tweak to form field names:
// now in AppServiceProvider instead of adding to each individual Filament/PanelProvider

// Labels like 'Head Line' not 'Head line':
$overrideDefaultLabel = function (Field|Column $o): void {
$o->label(
str($o->getName())
->beforeLast('.')
->afterLast('.')
->headline()
);
};

Column::configureUsing($overrideDefaultLabel);
Field::configureUsing($overrideDefaultLabel);
// now in AppServiceProvider instead of adding to each individual Filament/PanelProvider

// Labels like 'Head Line' not 'Head line':
$overrideDefaultLabel = function (Field|Column $o): void {
$o->label(
str($o->getName())
->beforeLast('.')
->afterLast('.')
->headline()
);
};

Column::configureUsing($overrideDefaultLabel);
Field::configureUsing($overrideDefaultLabel);
7 replies