Tracking Read/Unread or Viewed/NotViewed
This is a how-to, not a help-request:
Tracking Views of a record, per user.
views
migration:
View
model:
User
model:
Post
model:
Then, for the component that "shows" the record, set its mountUsing()
to track the "view":
CSS can be used to set a class when the isViewed()
attribute is truthy.4 Replies
So, for example combining both of these view indicators and tracking open-clicks on a Table that uses a Split/Grid (to show Cards instead of rows), define the
$table
with
And to register the css:
AppServiceProvider.php
/resources/views/custom-css.blade.php
:
@Jocka ^
The code above doesn't show how to mark it as "unread"/"unviewed", but you could toggle it from another action.Thank you so much
i already did an implementation which i could also send to you
Sure, I always like seeing the solutions others come up with for related problems!
Why not make it a relationship and use that to create views $this->views()->create()