SiGuy
Table Action always the same record
@Dan Harrin Update: after further investigation, it seems to occur only, if you have actiongroups within actiongroups.
Reproduce with out-of-the-box delete Action:
$table->actions([
ActionGroup::make([
ActionGroup::make([
DeleteAction::make(),
//RestoreAction::make()
])->dropdown(false)
])
])
Any Idea? We have a lot of actions, which is why we grouped them into separate logical groups in one larger dropdown...
14 replies
Table Action always the same record
@Dan Harrin I have the same issue on v3 with a table Action (inside a panel, not as OP stated with custom livewire component). First time I trigger the Action, the correct record is injected, afterwards this same record is used for each row (and no loading indicator is shown)...
It seems as if all the record Ids are the same after the table gets refreshed after the action succeeded / is cancelled
wire:click="mountTableAction('manage-tags-table', 'xxxxxxx')" // xxx is an individual id after page load for each record. After the table gets refreshed through the table action, all click handlers receive the ID or the record of the row that has been selected for the first run of the action....
Probably a Dom Diffing sideeffect! Happy to supply code, if needed
14 replies
How to record the last login (online) time of a user?
add a last_activty column to the user table, then in the middleware you udate the timestamp in the db for the currently logged in user (or you get the user object from the request) and on the user model you dont check the cache, but instead just check whether the TS is older than x minutes to return true/false
51 replies
How to record the last login (online) time of a user?
sorry - you are absolutely right. i switched to cache because i only needed the info whether the user is online or not. But you could just exchange cache for a column on the user table. I think i mentioned this in my initial answer.... maybe it was a bit confusing, because i mixed up the implementations ^^
51 replies
How to record the last login (online) time of a user?
If you really want a "correct" implementation (user is set to offline, once he closes the browser) you would need to do it with websockets and presense channels, as stated before in my first answer...
51 replies
How to record the last login (online) time of a user?
There is no "isOnline" model. "isOnline" is a method on the User Model. And the last active timestamp is set on every request that the user makes, because it is set in the middleware... you only need to register the middleware in your web stack....
51 replies