Closed c-delouvencourt closed 4 months ago
Hey @c-delouvencourt, thanks for the PR, it looks well thought out! And huge sorry for taking so long to get back to you on this one. The last few weeks have been hectic for me, so I'm just trying to catch up now.
I do think this is a pretty neat idea that could add some extra customisation. But I think I'm going to hold off on merging it for the time being since it adds extra code/logic for me to maintain. However, if enough devs think this would be helpful to them, I'll definitely think about implementing this! 😄
For what it's worth, I was just trying to override the ShortURL
model to add a reverse relationship (morph) and discovered that was no mechanism to do so.
Searching the issues for 'model' led me here.
I would find this functionality useful.
Custom Tables and Models
By default, the package will use the
short_urls
andshort_url_visits
tables and theShortURL
andShortURLVisit
models. However, you may want to use your own custom tables and models.To do this, you can set the connection name using the
urls_model
,urls_table
,visits_model
andvisits_table
' config value in theconfig/short-url.php
file like so:And then create your own models that extend the package's models: