Skip to content

Code update and refractor #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

KalimeroMK
Copy link

Removed DB::raw() from pluck() to avoid Query\Expression conversion
Extracted logic into helper methods (shouldTrack(), storePageView()...
Add methods to get data through Analytics facade
create getLast28Days(), getLast3Months(), getLast6Months(), getLastYear(), and getCustomRange() method update controller create route file update model for fillable and cast

…rrors.

Added as date and as count in selectRaw() to ensure pluck() works correctly.
Kept groupBy(DB::raw('DATE(created_at)')) for accurate aggregation by days.
update composer json as well
…getRouteModel()) for better readability.

Improved exception handling – the catch block is now outside of storePageView(), keeping concerns separate.
Optimized conditions – unnecessary checks and redundant logic removed.
Used Laravel’s Str::limit() instead of Str::substr() for better readability.
Used header() method for IP & referer handling – avoids redundant ternary checks
…ar(), and getCustomRange() method update controller create route file update model for fillable and cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant