bilfeldt / laravel-route-statistics

Log requests and group together for aggregated statistics of route usage
MIT License
227 stars 23 forks source link

Configurable user model & new aggregate value #34

Closed DevHoracioRodriguez closed 6 months ago

DevHoracioRodriguez commented 6 months ago

Description

Making user model configurable and add SECOND aggregate to set microsecond to 0.

Does this close any currently open issues?

No. But the configurable model is needed to make code compatible with LdapRecord. LdapRecord, when using database configuration, the user relation is from auth.providers.users.database.model and not from auth.providers.users.model. Therefore, both packages won't work together. As of now, a custom model is required.

The aggregate is needed for MSSQL. Currently, once date is inserted, the datetime value still accepting time other than 0.

Before aggregate: 2024-04-29 00:00:00.950 After aggregate: 2024-04-30 00:00:00.000

DevHoracioRodriguez commented 6 months ago

In our side, now the counter updates as expected.

DevHoracioRodriguez commented 6 months ago

Hello @bilfeldt

Thank you for accepting some changes.

Is there anything wrong with the relationship changes? route-statistics.php & RouteStatistic.php updates were removed.

Could those changes be added to make user model configurable? At least similar to logger...

bilfeldt commented 6 months ago

@CyberEkklesiaOwner sorry about the confusion.

Can you please make a separate PR for the user model config, then I will happily merge that.

DevHoracioRodriguez commented 6 months ago

@bilfeldt, no worries!

Please, review new PR #35

Thank you for the opportunity.