Fly_Moe
Fly_Moe
FFilament
Created by Fly_Moe on 7/10/2024 in #❓┊help
The GET method is not supported for route /. Supported methods: HEAD.
Getting that error and I'm not sure why or even how to debug this. The laravel.log file has no error. Looking at the debuggar it just shows that error so I have no clue how to debug this.
We get this error when i do: php artisan route:cache If I do this everything works: php artisan route:clear I was told we want to cache the routes though. Any advice on how to debug this?
8 replies
FFilament
Created by Fly_Moe on 6/21/2024 in #❓┊help
searchable attribute
I created an attribute that combines the first name and last name of the customers relationship. This makes the column unsearchable. protected function getFullNameAttribute(): array { return $this->customers->map(function ($customer) { return $customer->FirstName . ' ' . $customer->LastName; })->unique()->all(); } I tried making is searchable based off the filament documentation like this but this doesn't work either. I'm probably doing something stupid. Any chance someone has done something similar and got this working? TextColumn::make('full_name') ->label('Users') ->badge() ->searchable(query: function (Builder $query, string $search): Builder { return $query ->where('customer.FirstName', 'like', "%{$search}%") ->orWhere('customer.LastName', 'like', "%{$search}%"); })
3 replies
FFilament
Created by Fly_Moe on 2/29/2024 in #❓┊help
Close persistent notification by clicking in app
I have a few persistent notifications that are rather lengthy. Obviously, the user can click on the "x" in the upper right. But is there a way to close the notification by clicking inside the app and closing the notification that way? I know I can add a timer on the notification but don't want to limit how long the notification is shown.
2 replies
FFilament
Created by Fly_Moe on 1/31/2024 in #❓┊help
Form with optional repeater failing to save
Hello everyone, I have an optional repeater inside a form. If it's filled out, it will save correctly with no error. However, if the repeater is left blank it will error out with this error:
Cannot insert the value NULL into column 'Name', table 'Detail'; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column 'Name', table 'Detail'; column does not allow nulls. INSERT fails.
Obviously it's trying to insert the repeater form into the Detail table. How do I stop that from happening when the repeater is blank and not filled out? Any help would be appreciated. Thanks. Here's my form:
<?php

public static function form(Form $form): Form
{
return $form
->schema([
Section::make('')
->schema([
TextInput::make('Name')
->required()
->minLength(2)
->maxLength(191),
Toggle::make('IsActive')
->default(true)
->onColor('success')
->offColor('danger'),
]),
Section::make('Details')
->schema([
Repeater::make('Detail')
->schema([
TextInput::make('Name'),
Toggle::make('IsRequired')
->default(false)
->onColor('success')
->offColor('danger')
->label('require'),
])
->label('Detail')
->deleteAction(
fn (Forms\Components\Actions\Action $action) => $action->requiresConfirmation(),
)
->addActionLabel('Add Detail')
->relationship()
->reorderableWithButtons()
->orderColumn('Rank')
->cloneable()
]),
]);
}
<?php

public static function form(Form $form): Form
{
return $form
->schema([
Section::make('')
->schema([
TextInput::make('Name')
->required()
->minLength(2)
->maxLength(191),
Toggle::make('IsActive')
->default(true)
->onColor('success')
->offColor('danger'),
]),
Section::make('Details')
->schema([
Repeater::make('Detail')
->schema([
TextInput::make('Name'),
Toggle::make('IsRequired')
->default(false)
->onColor('success')
->offColor('danger')
->label('require'),
])
->label('Detail')
->deleteAction(
fn (Forms\Components\Actions\Action $action) => $action->requiresConfirmation(),
)
->addActionLabel('Add Detail')
->relationship()
->reorderableWithButtons()
->orderColumn('Rank')
->cloneable()
]),
]);
}
3 replies