Arjan
Follow/Unfollow record is not working
I want to toggle follow/unfollow actions for each $record (table row):
However, when I click 'follow,' the action gets executed, but the 'follow' action does not get hidden, and the unfollow action does not get shown.
I am using
but this does not work. Please help.
6 replies
QueryBuilder -> NumberConstraint for Money
Hi,
I am storing an amount in cents in the database as integer in field 'gross'. And I am converting cents to dollars using casting:
So, 100 dollars are saved in the database as 10000 (cents). Now, I want to make a NumberConstraint so the user can filter this integer field 'gross' by providing dollars (NOT cents). Input '100' should be converted to '10000' so the correct rows are filtered from the database. How do I do this??? Thanks for your help.
6 replies
Call to a member function getRelationExistenceQuery() on null
I am using this filter:
the parent is a morphTo relation from Asset. The loading of options is executed normally. But then when I select an option I get the error 'Call to a member function getRelationExistenceQuery() on null'.
Parent morphs now to 2 different models. Strange thing is that if parent only uses (morphs to) 1 model there is NO error and everthing works correctly. PLEASE HELP!
2 replies
QueryBuilder with an relationship->counts()
Hi,
I am using this column with a count of related Assets (hasMany relationship) in my table:
TextColumn::make('assets_count')
->numeric()
->label('Assets')
->counts('assets'),
I now want to make a filter for this column using Querybuilder:
NumberConstraint::make('assets_count')
->relationship(
name: 'assets',
titleAttribute: 'id',
modifyQueryUsing: fn(Builder $query) => $query->count(),
)
->label("Assets"),
However this NumberContraint is not working and throws this error:
SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "series" LINE 1: select count() as aggregate from "assets" where "series"."i... ^
SELECT count() AS aggregate FROM "assets" WHERE "series"."id" = "assets"."series_id"
Please help!
Thanks!
5 replies