TiBiBa
TiBiBa
FFilament
Created by TiBiBa on 7/25/2024 in #❓┊help
Prevent allowDuplicates() when using detach action
Thanks for your reply! I did just that, made an custom action to match the id's and manually remove the record.
5 replies
FFilament
Created by TiBiBa on 2/2/2024 in #❓┊help
Keep svg viewBox attribute on custom sanitizer doesn't work
Fixed this by implementing a SvgColumn ourselves
4 replies
FFilament
Created by fajriannugraha on 2/1/2024 in #❓┊help
How to access "TextInput" data from Resource to Relation manager?
You can use $livewire->OwnerRecord to access the owner record when in a relation tab
3 replies
FFilament
Created by TiBiBa on 1/16/2024 in #❓┊help
Possible to get record from the table row above current row?
Found a way to implement this:
private function copyAttributeAbove(string $attribute, Table $table, Task $record): void
{
$records = $table->getRecords();
$currentRecordIndex = $records->search(function($tableRecord) use ($record) {
return $record->id === $tableRecord->id;
});

if ($currentRecordIndex == 0) {
return;
}

$previousRecord = $records->slice($currentRecordIndex-1, 1)->first();
$record->update([
$attribute => $previousRecord[$attribute],
]);
}
private function copyAttributeAbove(string $attribute, Table $table, Task $record): void
{
$records = $table->getRecords();
$currentRecordIndex = $records->search(function($tableRecord) use ($record) {
return $record->id === $tableRecord->id;
});

if ($currentRecordIndex == 0) {
return;
}

$previousRecord = $records->slice($currentRecordIndex-1, 1)->first();
$record->update([
$attribute => $previousRecord[$attribute],
]);
}
4 replies
FFilament
Created by dennis_de on 12/11/2023 in #❓┊help
Notifications are only displayed by Refresh
If I recall correctly adding these solved the issue:
\App\Http\Middleware\setSessionDomain::class,
\App\Http\Middleware\EncryptCookies::class, \Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\setSessionDomain::class,
\App\Http\Middleware\EncryptCookies::class, \Illuminate\Session\Middleware\StartSession::class,
Are these all present in your used middleware?
69 replies
FFilament
Created by dennis_de on 12/11/2023 in #❓┊help
Notifications are only displayed by Refresh
I had a similar issue and it was solved adding missing middleware in Kernel.php
69 replies
FFilament
Created by TiBiBa on 10/2/2023 in #❓┊help
Possibility to hide sign out option in user menu?
As it is nested just taking the last child doesn't work. The following however does:
.fi-user-menu > :last-child > :last-child {
display: none;
}
.fi-user-menu > :last-child > :last-child {
display: none;
}
7 replies
FFilament
Created by TiBiBa on 10/2/2023 in #❓┊help
Possibility to hide sign out option in user menu?
I thought so as well, but how to distinguish the logout item from the other items? It does not have any unique class or id to style for.
7 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
I finally managed to fix this. Long story short: We defined custom middleware groups to completely separate between our admin panel and other application. Due to this change the web middleware was still empty. The notifications issue was solved by adding \Illuminate\Session\Middleware\StartSession::class to the empty web array.
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
The question is independent of how the forms works. It's a general issue with displaying notifications. For an unknown reason they are displayed as expected before the mount(), but afterwards not.
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
I tried, but unfortunately the codebase is too complex to separate en share publicly. I did find some more info. When rendering a page the session has some attributes (as shown in the debugbar) but when I submit a form the session seems to be emptied?
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
Then the AdminServiceProvider registers the appPanelProvider
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
This is a bit of a complex file were we decide if the provider we need is the admin or any of our other applications with something like this:
private function _getApplicationProvider() {
if ($isAdmin) {
// Set app type to admin (for when local)
config(['app.type' => 'admin']);
return self::$ApplicationTypes['admin'];
}

if (config('app.type')) {
return self::$ApplicationTypes[config('app.type')];
}

return self::$ApplicationTypes['webapp'];
}
private function _getApplicationProvider() {
if ($isAdmin) {
// Set app type to admin (for when local)
config(['app.type' => 'admin']);
return self::$ApplicationTypes['admin'];
}

if (config('app.type')) {
return self::$ApplicationTypes[config('app.type')];
}

return self::$ApplicationTypes['webapp'];
}
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
This is the appPanelProvider
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
The issue occurs on all pages, also the default resource ones. I made a new custom page that reproduces the error. But once again, it seems the issue is globally.
<?php

namespace App\Admin\Pages;

use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Notifications\Notification;
use Filament\Pages\Page;

class NotificationTest extends Page implements HasForms {

use InteractsWithForms;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'admin.pages.notification-test';

public function mount(): void
{
Notification::make()
->title('This notification works fine!')
->warning()
->send();

$this->form->fill([]);
}

public function submit(): void
{
Notification::make()
->title('No results found for your search query')
->warning()
->send();

// The dd() below works fine when we uncomment the line
// dd('We get here!');
}
}
<?php

namespace App\Admin\Pages;

use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Notifications\Notification;
use Filament\Pages\Page;

class NotificationTest extends Page implements HasForms {

use InteractsWithForms;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'admin.pages.notification-test';

public function mount(): void
{
Notification::make()
->title('This notification works fine!')
->warning()
->send();

$this->form->fill([]);
}

public function submit(): void
{
Notification::make()
->title('No results found for your search query')
->warning()
->send();

// The dd() below works fine when we uncomment the line
// dd('We get here!');
}
}
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
Unfortunately it’s a corporate project and I’m unable to share the whole project. I can provide required code snippets though.
18 replies
FFilament
Created by TiBiBa on 8/30/2023 in #❓┊help
Notifications works when triggered on mount() but not when triggered on submit()?
I did, but couldn’t find an answer and I’m unable to find the old question within this channel.
18 replies
FFilament
Created by TiBiBa on 8/28/2023 in #❓┊help
Associate headerAction not showing on Relation manager?
Just found a solution. This is due to the relations only being readOnly on view by default. Hiding all actions that can mutate the relation (so all instead of the view). Adding the following to your relation is the fix:
public function isReadOnly(): bool
{
return false;
}
public function isReadOnly(): bool
{
return false;
}
4 replies
FFilament
Created by TiBiBa on 8/14/2023 in #❓┊help
Possible to dispatch event in submit() function after variables are updated?
This works, you absolutely made my day. Was working on a solution for hours. Thanks!
5 replies
FFilament
Created by Rasasak on 8/1/2023 in #❓┊help
How to start theme
Just run npm run dev
9 replies