Read-Only model implementation #59014
Unanswered
mysticseagull
asked this question in
Ideas
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Just FYI here is a package that do what you wish for per model: https://github.com/michaelachrisco/ReadOnlyTraitLaravel Its fairly popular and I keep it up to date. I discussed making it part of the laravel framework 9/10ish years ago(?) but I believe the consensus at the time was that they didnt want it in the main repo/setup. It has some niceties over the years that people have added to make it have more options. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a read-only mode trait for models to help with DX and causing fewer runtime errors when an a developer tries to insert data into a materialized view or other sources within a database, this trait also just allows disabling a model for writes in the case that you need it.
I have been debating on opening a PR for my implementation, wanted to hear some thoughts first on if this is useful.
Beta Was this translation helpful? Give feedback.
All reactions