πTeR
πTeR
FFilament
Created by πTeR on 1/9/2024 in #❓┊help
Datepicker in a Table List
Id like to put a datepicker into a Table List to quick change the row date. How can I do this? Using custom fields? Thank you
6 replies
FFilament
Created by πTeR on 1/7/2024 in #❓┊help
How can I sort a table using a relationship?
In a column I have this relationship:
return $table
->columns([
Tables\Columns\TextColumn::make('enterprise.name')
->label('Empreendimento')
->sortable()
->searchable(),
...
return $table
->columns([
Tables\Columns\TextColumn::make('enterprise.name')
->label('Empreendimento')
->sortable()
->searchable(),
...
How can I apply a default sort? I try it, but this is not work!
->defaultSort(function ($query, $direction) {
$query->orderBy('enterprise.name');
})
->defaultSort(function ($query, $direction) {
$query->orderBy('enterprise.name');
})
5 replies
FFilament
Created by πTeR on 10/6/2023 in #❓┊help
It is possible do use __construct on Edit Page?
I'm using a service on a __construct inside a create page, and it is working like a charm. But when I use it in a EditPage, I have this error message Target [App\Http\Services\PaymentTransaction\PaymentTransactionServiceContract] is not instantiable while building [App\Filament\Resources\PaymentIntentionResource\Pages\EditPaymentIntention].
5 replies
FFilament
Created by πTeR on 9/18/2023 in #❓┊help
Update relationship manager table when edit a record
On my payment edit page I have a Relationship Manager to list all my transactions, when I edit this page I add a new transaction, but my Relationship Table does not update, how to can solve it?
10 replies
FFilament
Created by πTeR on 8/20/2023 in #❓┊help
Multiple login models
Hello, how can I use multiple models to diferent logins? Like user model and consumermodel? I tried to build diferent panels and set a Login class in a customer panel, like that:
return $panel
->id('app')
->path('app')
->login(**AppLogin::class**)
return $panel
->id('app')
->path('app')
->login(**AppLogin::class**)
So, in AppLogin class, I have duplicated all default Login class ( Filament\Pages\Auth\Login.php) Well.. I think in the method I need to pass something to indicate I´d like to get Consumer models instead User model right?
public function authenticate(): ?LoginResponse
{
try {
$this->rateLimit(5);
} catch (TooManyRequestsException $exception) {
// Catch implementation
}
$data = $this->form->getState();

if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
throw ValidationException::withMessages([
'data.email' => __('filament-panels::pages/auth/login.messages.failed'),
]);
}

session()->regenerate();

return app(LoginResponse::class);
}
public function authenticate(): ?LoginResponse
{
try {
$this->rateLimit(5);
} catch (TooManyRequestsException $exception) {
// Catch implementation
}
$data = $this->form->getState();

if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
throw ValidationException::withMessages([
'data.email' => __('filament-panels::pages/auth/login.messages.failed'),
]);
}

session()->regenerate();

return app(LoginResponse::class);
}
But I really don´t know what I need to do here.. Someone can help me? Thanks
7 replies
FFilament
Created by πTeR on 8/17/2023 in #❓┊help
How can I reuse slug update configurations?
return $form->schema([
TextInput::make('description')
->live()
->afterStateUpdated(function (Get $get, Set $set, ?string $old, ?string $state) {
if (($get('slug') ?? '') !== Str::slug($old)) {
return;
}

$set('slug', Str::slug($state));
}),
return $form->schema([
TextInput::make('description')
->live()
->afterStateUpdated(function (Get $get, Set $set, ?string $old, ?string $state) {
if (($get('slug') ?? '') !== Str::slug($old)) {
return;
}

$set('slug', Str::slug($state));
}),
How can I reuse the callback on afterStateUpdated() between I my Forms? I have 4 Forms that uses slug and descriptions fields and I like to reuse it, because all was the same. Thanks
5 replies