ash-jc-allen / short-url

A Laravel package for creating shortened URLs for your web apps.
MIT License
1.25k stars 157 forks source link

[FR] make it possible to overwrite the models #193

Closed goellner closed 1 year ago

goellner commented 1 year ago

It would be amazing, if we could overwrite the models. For example iI would need to add more columns to the ShortURLVisit. Maybe add it to the config as described here: https://freek.dev/2442-strategies-for-making-laravel-packages-customizable

Let me explain my example a bit more: Would need to add a custom column called type which would just be a string/enum column with lets say qr and link values. My target url would include a query param ?type=qr and this should be tracked in the short_url_visits.type column.

By using my own model i can add the column to the fillable properties. The next bit that would need customising is the trackVisit function in the Resolver.