AmauryCid
AmauryCid
FFilament
Created by AmauryCid on 5/29/2024 in #❓┊help
Livewire Component Not Working
Hello, I add a livewire component consisting on a select of options. When the select changes, nothing happens (can't see a network request on devtools). This is the livewire component:
<?php

namespace App\Livewire;

use App\Models\Agency;
use Livewire\Component;

class SelectAgency extends Component
{
public $selectedOption;

public $options = [];

public function mount()
{
$this->selectedOption = session('agency.id');
$this->fetchOptions();
}

public function fetchOptions()
{
$this->options = Agency::where('status_id', 3)->pluck('name', 'id')->toArray();
}

public function updatedSelectedOption($value)
{
session(['agency.id' => $value]);
}

public function render()
{
return view('livewire.select-agency');
}
}
<?php

namespace App\Livewire;

use App\Models\Agency;
use Livewire\Component;

class SelectAgency extends Component
{
public $selectedOption;

public $options = [];

public function mount()
{
$this->selectedOption = session('agency.id');
$this->fetchOptions();
}

public function fetchOptions()
{
$this->options = Agency::where('status_id', 3)->pluck('name', 'id')->toArray();
}

public function updatedSelectedOption($value)
{
session(['agency.id' => $value]);
}

public function render()
{
return view('livewire.select-agency');
}
}
The component renders fine, but on change nothing happens.
6 replies
FFilament
Created by AmauryCid on 3/8/2024 in #❓┊help
Filter Table by Querystring
Hi there! Any suggestion on how could I filter a table by a url querystring parameter...? Your help is appreciated.
8 replies
FFilament
Created by AmauryCid on 3/1/2024 in #❓┊help
Notifications Database Connection
Hi there. I'm trying to set a connection for the notifications table in a separate database. I managed to do this extending notification model and setting
protected $connection = 'mysql2';
protected $connection = 'mysql2';
but didn't work. Any suggestions...?
1 replies
FFilament
Created by AmauryCid on 2/27/2024 in #❓┊help
Database Notification Data
I want to add custom json data to a database notification. I see there's no method for this. How could I achieve it? Also, how about modify de type column in the database?
4 replies
FFilament
Created by AmauryCid on 2/22/2024 in #❓┊help
Export Action -No modal for column selection
How could we prevent showing the modal with column selections when exporting csv/excel data?
2 replies
FFilament
Created by AmauryCid on 12/7/2023 in #❓┊help
Sort RepeatableEntry
Hello there! Can somebody please suggest me how could I sort a repeatable entry of a relationship...?
4 replies
FFilament
Created by AmauryCid on 11/13/2023 in #❓┊help
Select Filter on top menu
Hello, can somebody kindly suggest me how I could set a select filter on the top menu to filter a table component?
2 replies
FFilament
Created by AmauryCid on 10/26/2023 in #❓┊help
Set session attribute on login
Hello, how can I customize that after a successful login I could set a session attribute?
5 replies
FFilament
Created by AmauryCid on 9/30/2023 in #❓┊help
Summarize Relationship Column
Hello, can someone suggest how to custom summarize a relationship column? The Query\Builder class on the ->using() method doesn't let me access relationships on the $query model (as in Eloquent\Builder).
2 replies
FFilament
Created by AmauryCid on 9/29/2023 in #❓┊help
Summarize Relationship aggregate
Hi, is there a way to custom summarize a relationship sum aggregate? Something like:
TextColumn::make('totalHours')
->label('Total Hours')
->state(fn(Model $record) =>
$record->payroll_items_sum_reg_hours +
$record->payroll_items_sum_ot_hours)
->summarize(Summarizer::make()
->label('Total')
->using(fn(Builder $query): string =>
$query->payroll_items_sum_reg_hours + $query->payroll_items_sum_ot_hours)),
TextColumn::make('totalHours')
->label('Total Hours')
->state(fn(Model $record) =>
$record->payroll_items_sum_reg_hours +
$record->payroll_items_sum_ot_hours)
->summarize(Summarizer::make()
->label('Total')
->using(fn(Builder $query): string =>
$query->payroll_items_sum_reg_hours + $query->payroll_items_sum_ot_hours)),
This throws a: Undefined property: Illuminate\Database\Query\Builder::$payroll_items_sum_reg_hours How could I access the relationship in the summarizer?
5 replies
FFilament
Created by AmauryCid on 8/29/2023 in #❓┊help
SelectFilter on NavBar
Hello, I wonder if is possible to put a SelectFilter in the top navigation bar to filter table results on page body...? (instead of table top/bottom)
4 replies
FFilament
Created by AmauryCid on 8/19/2023 in #❓┊help
EloquentQuery Type Hinting
Hello, I have this block working fine: /** * @return Builder<Billing> */ public static function getEloquentQuery(): Builder { return parent::getEloquentQuery() ->withAuthNumber(); } But phpstan throws this: Call to an undefined method Illuminate\Database\Eloquent\Builder::withAuthNumber() Method is declared on model: @method static Builder|Billing withAuthNumber() /** * @param Builder<Billing> $query * @return Builder<Billing> */ public function scopeWithAuthNumber(Builder $query): Builder Someone help, please.
6 replies