ash-jc-allen / short-url

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

Add model fillable attributes to config #203

Closed Tarek-Solaiman closed 1 year ago

Tarek-Solaiman commented 1 year ago

Since the migrations are publishable, it's better to let the user define which fields are fillable. of course the original fillable attributes remains the same in the models and config file, the user can define their own fields, which they can add to the migration files, so adding additional data to the model can be easily achieved by accessing the created model or listening to the fired ShortURLVisited event, or even creating an observer.

ash-jc-allen commented 1 year ago

Hey @Tarek-Solaiman, thanks for the PR! I'm super busy at the moment, but I'll try and take a look at this at some point this week if I get a chance 😄

Tarek-Solaiman commented 1 year ago

Hey @Tarek-Solaiman, thanks for the PR! I'm super busy at the moment, but I'll try and take a look at this at some point this week if I get a chance 😄

No problem, please take your time. I'm happy to wait until things settle down for you ✌️

ash-jc-allen commented 1 year ago

Hey @Tarek-Solaiman! I'm really sorry for taking so long to check this one out. Unfortunately, I think I'm going to close this PR for the time being, sorry.

I think if someone needs to set any values on the ShortURL or ShortURLVisit models that aren't in the package's $fillable arrays, I'd probably suggest using something like $shortURL->forceFill([...]).

But if enough people want this type of feature in the future, it's something I'd be open to merging in.

Thanks for taking the time to make the PR, I appreciate it! 😄