JimKarvo
JimKarvo
FFilament
Created by JimKarvo on 7/17/2024 in #❓┊help
Trying to populate data from the table to widget
Hello, I have a livewire component with a filamentphp table (not a dashboard). I also have a stats widget at the header. I am trying to populate the widget from the table's data (using table filters) This example seems that works only under list page. Are there any workaround that I can make this works under livewire component that includes the table and widget?
2 replies
FFilament
Created by JimKarvo on 3/28/2024 in #❓┊help
Unable to retrieve the file_size for file at location: livewire-tmp/livewire-tmp. For files more tha
No description
2 replies
FFilament
Created by JimKarvo on 10/18/2023 in #❓┊help
Passing data between Wizard steps
Hello, I am trying to achieve this: After a user inputs a url at first wizard step, and clicks next, to pass the url's data (it will call an API system, I will generate an array) at 5 Selects on second step, in order for a user to map the APIs data with our logic. I have tried to do this with "afterValidation()" function, with no luck
->afterValidation(
function ($state, callable $set) {
$xml_data = simplexml_load_file($state['url_input']);
// some logic here to return the array
$set('field_from_tab1', $resultArray);

})

,
->afterValidation(
function ($state, callable $set) {
$xml_data = simplexml_load_file($state['url_input']);
// some logic here to return the array
$set('field_from_tab1', $resultArray);

})

,
with no luck. Although, I tryied to do the same at Select->option() function, but it is not good practive to call the same API 5 times to get the same data... How it is possible to pass the data from one step to another? it is possible somehow to set a global variable, save the data globally and retrieve them later?
4 replies
FFilament
Created by JimKarvo on 8/13/2023 in #❓┊help
Relationship problems? (relationship with where)
Hello, I have this relationship at my model:
public function customer_price_change_beta()
{
return $this->hasOne(CustomerPriceChangesBeta::class, 'customer_id', 'customer_id')
->where('product_id', $this->product_id)
;
}
public function customer_price_change_beta()
{
return $this->hasOne(CustomerPriceChangesBeta::class, 'customer_id', 'customer_id')
->where('product_id', $this->product_id)
;
}
The relationships work very well outside filamentphp (eg at controller and lavarel's blade) At filamentphp I get an empty string. If I remove the where statement the relationship returns data (but it is wrong) This is a Filament bug?
9 replies
FFilament
Created by JimKarvo on 7/30/2023 in #❓┊help
Is it possible to customize since()?
I am tryinig to calculate the remaing days of user's subscription, but I get one day less, maybe because the mySql table of expired_date is set to 'yyyy-mm-dd', and the carbon is based on dateTime! So, is it possible, without change my date at mysql, to recalculate the since() by adding one day? what I have already:
Carbon::setLocale('el');
//...
Tables\Columns\TextColumn::make('credits.expiration_date')
->sortable()
->since()
->placeholder('Δοκιμαστική περίοδος')
->tooltip(function ($record){
//return $record->credits->expiration_date as human readable, in greek language. don't include time, only date
return Carbon::parse($record->credits->expiration_date)->isoFormat('LL');

})
->label('Ημερομηνία Λήξης'),
Carbon::setLocale('el');
//...
Tables\Columns\TextColumn::make('credits.expiration_date')
->sortable()
->since()
->placeholder('Δοκιμαστική περίοδος')
->tooltip(function ($record){
//return $record->credits->expiration_date as human readable, in greek language. don't include time, only date
return Carbon::parse($record->credits->expiration_date)->isoFormat('LL');

})
->label('Ημερομηνία Λήξης'),
4 replies
FFilament
Created by JimKarvo on 7/28/2023 in #❓┊help
Pagination urls above the table or scroll up after change page
Hello, After I click at the next page on pagination, and the page is loaded it is not scrolling up to the first result of the table. Is it possible to achieve this? Also is it possible to have the paginated links at the top of the table, and not only at the bottom? Thank you!
24 replies