Señor Nikola
Señor Nikola
FFilament
Created by Señor Nikola on 2/21/2025 in #❓┊help
Custom Action within TablesRenderHook::TOOLBAR_SEARCH_BEFORE
Hello, I created custom render hook
->renderHook(
TablesRenderHook::TOOLBAR_SEARCH_BEFORE,
fn (): string => Livewire::mount('table-toolbar-items'),
)
->renderHook(
TablesRenderHook::TOOLBAR_SEARCH_BEFORE,
fn (): string => Livewire::mount('table-toolbar-items'),
)
Within component i created Action from "Filament\Actions\Action", it get's rendered but it wont have any effect when clicked any idea why?
7 replies
FFilament
Created by Señor Nikola on 2/20/2025 in #❓┊help
Generating Current View for PDF
Hi, This is kinda part of filament from my point of view that's why i decided to ask here if anyone knows solution. I am trying to develop action from filament, which will generate PDF from current view. So action contains basic stuff
public function generatePdfAction(): Action
{
return Action::make('generatePdfAction')
->label('Generate PDF')
->extraAttributes(['data-generate-pdf' => true])
->action(function () {

});
}
public function generatePdfAction(): Action
{
return Action::make('generatePdfAction')
->label('Generate PDF')
->extraAttributes(['data-generate-pdf' => true])
->action(function () {

});
}
And this is my livewire component with js to send current page HTML
<div>
{{-- Care about people's approval and you will be their prisoner. --}}
{!! $this->generatePdfAction()->render() !!}

@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('[data-generate-pdf]').addEventListener('click', function (e) {
e.preventDefault();

const fullHtml = document.documentElement.outerHTML;

Livewire.dispatch('generate-pdf', { html: fullHtml });
});
});
</script>
@endpush
</div>
<div>
{{-- Care about people's approval and you will be their prisoner. --}}
{!! $this->generatePdfAction()->render() !!}

@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('[data-generate-pdf]').addEventListener('click', function (e) {
e.preventDefault();

const fullHtml = document.documentElement.outerHTML;

Livewire.dispatch('generate-pdf', { html: fullHtml });
});
});
</script>
@endpush
</div>
And it works, PDF gets generated but issue arises that it is generated for tablet resolution and it is really narrow, any idea how can i get from filament html that is from my viewpoint? Is it possible or am I overeaching ? Btw, I am using spaties laravel pdf package.
5 replies
FFilament
Created by Señor Nikola on 2/18/2025 in #❓┊help
Toggle Column Prevent Action
Hello, I have an issue cannot seem to figure out where to place my check on record if it has all requried fields - only than it can be activated. I tried beforeStateUpdated but it throws warning but still proceeds to update that record? Any idea how to prevent it?
Tables\Columns\ToggleColumn::make('active')
->disabled(function (Project $record) {
return !$record->hasAllRequiredFields();
})
->afterStateUpdated(function(){
Cache::forget(CacheManager::makeCacheToken("active_projects"));

Notification::make()
->success()
->title(__("Project Status Updated"))
->send();
}),
Tables\Columns\ToggleColumn::make('active')
->disabled(function (Project $record) {
return !$record->hasAllRequiredFields();
})
->afterStateUpdated(function(){
Cache::forget(CacheManager::makeCacheToken("active_projects"));

Notification::make()
->success()
->title(__("Project Status Updated"))
->send();
}),
3 replies
FFilament
Created by Señor Nikola on 1/30/2025 in #❓┊help
Swap Action Buttons
Hi, Is there an easy way to swap these modal footer actions postiion "cancel" to be left and "submit" to be right?
public function updateTitleAction (): Action
{
return Action::make('updateTitleAction')
->label(__("Update Title"))
->form(function (array $arguments) {
$item = NavigationItem::findOrFail($arguments['id']);

return [
$this->getTextInputField(
column: 'title',
label: __('inputs.title'),
placeholder: __('inputs.title_placeholder'),
)
->autofocus(false)
->default($item->title)
];
})
->badge()
->modalFooterActions(function ($action) {

})
->action(function (array $data, $arguments): void {
$this->updateItemTitle($arguments['id'], $data['title']);
});
}
public function updateTitleAction (): Action
{
return Action::make('updateTitleAction')
->label(__("Update Title"))
->form(function (array $arguments) {
$item = NavigationItem::findOrFail($arguments['id']);

return [
$this->getTextInputField(
column: 'title',
label: __('inputs.title'),
placeholder: __('inputs.title_placeholder'),
)
->autofocus(false)
->default($item->title)
];
})
->badge()
->modalFooterActions(function ($action) {

})
->action(function (array $data, $arguments): void {
$this->updateItemTitle($arguments['id'], $data['title']);
});
}
2 replies
FFilament
Created by Señor Nikola on 1/30/2025 in #❓┊help
Multiple Select Many to Many Disabled issue
Hello, Did anyone had issue with select when i chain disabled() function and also relationship is applied for many to many and multiple function is chained to Select. Main error i receive when i have disabled() i that Select does not look relationship and tries to insert to current model so i get error for mass assignment..
2 replies
FFilament
Created by Señor Nikola on 1/29/2025 in #❓┊help
Dispatch Event on AfterStateUpdated()
Hello, Does anyone know how to dispatch event for example to update-counter within main resource? Like we have $this->dispatch in Livewire components and in List,Edit filament classes, I need kind-a same thing but within main resource..
protected static function getStatusColumn (): Tables\Columns\SelectColumn
{
return Tables\Columns\SelectColumn::make('status')
->label(__("inputs.status"))
->options(ContactFormStatuses::class)
->sortable()
->afterStateUpdated(function($record) {
Notification::make()
->title(__('notifications.status_updated'))
->success()
->send();
$this->dispatch('update-counter');
})
->visible(fn() => self::$user->can('view_status' . self::RESOURCE_PERMISSION_SUFFIX));
}
protected static function getStatusColumn (): Tables\Columns\SelectColumn
{
return Tables\Columns\SelectColumn::make('status')
->label(__("inputs.status"))
->options(ContactFormStatuses::class)
->sortable()
->afterStateUpdated(function($record) {
Notification::make()
->title(__('notifications.status_updated'))
->success()
->send();
$this->dispatch('update-counter');
})
->visible(fn() => self::$user->can('view_status' . self::RESOURCE_PERMISSION_SUFFIX));
}
10 replies
FFilament
Created by Señor Nikola on 1/23/2025 in #❓┊help
Navigation Item Sorting
No description
3 replies
FFilament
Created by Señor Nikola on 1/19/2025 in #❓┊help
Tailwind Config Issue
Hello, Did anyone had issue with tailwind config, where I have to put everything custom in "safelist" in order to work? Is there maybe a way around it or am I doing something wrong in here?
import defaultTheme from "tailwindcss/defaultTheme";
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
mode: "jit",
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'vendor/awcodes/filament-tiptap-editor/resources/**/*.blade.php',
],
darkMode: "class",
theme: {
extend: {
colors: {
...defaultTheme.colors,
},
spacing: {
...defaultTheme.spacing,
},
fontSize: {
"3xs": "8px",
"2xs": "10px",
"xs": "12px",
},
maxWidth: {
'100-px': '100px',
'150-px': '150px',
'200-px': '200px',
'250-px': '250px',
},
minHeight: {
'100-px': '100px',
'150-px': '150px',
'200-px': '200px',
'250-px': '250px',
},
listStyleType: {
circle: 'circle',
},
}
},
// safelist: [
// {
// pattern: /max-w-[0-9]+-px/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// {
// pattern: /text-(\w+)-(100|200|300|400|500|600|700|800|900)/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// {
// pattern: /text-(3xs|2xs|xs|sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl)/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// ],
};
import defaultTheme from "tailwindcss/defaultTheme";
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
mode: "jit",
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'vendor/awcodes/filament-tiptap-editor/resources/**/*.blade.php',
],
darkMode: "class",
theme: {
extend: {
colors: {
...defaultTheme.colors,
},
spacing: {
...defaultTheme.spacing,
},
fontSize: {
"3xs": "8px",
"2xs": "10px",
"xs": "12px",
},
maxWidth: {
'100-px': '100px',
'150-px': '150px',
'200-px': '200px',
'250-px': '250px',
},
minHeight: {
'100-px': '100px',
'150-px': '150px',
'200-px': '200px',
'250-px': '250px',
},
listStyleType: {
circle: 'circle',
},
}
},
// safelist: [
// {
// pattern: /max-w-[0-9]+-px/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// {
// pattern: /text-(\w+)-(100|200|300|400|500|600|700|800|900)/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// {
// pattern: /text-(3xs|2xs|xs|sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl)/,
// variants: ['responsive', 'hover', 'focus', 'active'],
// },
// ],
};
2 replies
FFilament
Created by Señor Nikola on 1/13/2025 in #❓┊help
TipTap Style Issue On SlideOver
No description
2 replies
FFilament
Created by Señor Nikola on 1/10/2025 in #❓┊help
Page Action Modal Issue
No description
6 replies
FFilament
Created by Señor Nikola on 12/27/2024 in #❓┊help
Export Autosize Columns
Hello, is there a way to auto size columns in excel export like with maatwebsite/excel package that we can use ShouldAutoSize?
2 replies
FFilament
Created by Señor Nikola on 12/26/2024 in #❓┊help
Tailwind Classes Issue
No description
7 replies
FFilament
Created by Señor Nikola on 12/25/2024 in #❓┊help
Extra Table Classes
No description
4 replies
FFilament
Created by Señor Nikola on 12/16/2024 in #❓┊help
TipTap Disable Certain Headings
No description
5 replies
FFilament
Created by Señor Nikola on 12/12/2024 in #❓┊help
Revealable Password Via Password Component
No description
8 replies
FFilament
Created by Señor Nikola on 12/10/2024 in #❓┊help
TextColumn Setting Properties on AfterStateUpdated()
No description
5 replies
FFilament
Created by Señor Nikola on 12/9/2024 in #❓┊help
Table TextColumn URL() Styles
No description
2 replies
FFilament
Created by Señor Nikola on 11/27/2024 in #❓┊help
Filament Custom Page Multiple Tables
Hello, Is it possible that one filament page has multiple tables. I was following guide to implement HasTables and trait Interacts.. but that only works with public function table(Table $table) when I try to add other public funtcion it wont let me add it to from with {{ $this->exampleTable }}
4 replies
FFilament
Created by Señor Nikola on 11/26/2024 in #❓┊help
Filament TipTap Editor - YouTube Extension
Hello, I am having an issue how to add TipTap YouTube extension to filament Tiptap Editor plugin, has anyone done it I am unable to do it. Was following guide on official plugin website but was unsuccessfull. Would be super grateful if any knows how. 🙂
4 replies