You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, that's my first time writing and proposing something here.
I've been working with laravel for 2 years now and recently I started to understand the caveats of using cascade in constraints of our relational database, while writing migrations in laravel with this feature I noticed that sometimes I repeat myself too much declaring a constraint with the cascade event.
My ideia is, implement a shorthand function do declare a constraint with cascade event in a single function, like the example below.
The idea is not to replace the current syntax with the proposed one, but to have this short syntax if the dev wants to save some lines of code and some milliseconds. It can also prevent a human mistake every time the developer writes the bigger syntax.
I'm willing to implement this in a PR, I just need to make sure that this does not exist in the current laravel version and that the community likes the idea.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, that's my first time writing and proposing something here.
I've been working with laravel for 2 years now and recently I started to understand the caveats of using cascade in constraints of our relational database, while writing migrations in laravel with this feature I noticed that sometimes I repeat myself too much declaring a constraint with the cascade event.
My ideia is, implement a shorthand function do declare a constraint with cascade event in a single function, like the example below.
Instead of:
Have something like:
The idea is not to replace the current syntax with the proposed one, but to have this short syntax if the dev wants to save some lines of code and some milliseconds. It can also prevent a human mistake every time the developer writes the bigger syntax.
I'm willing to implement this in a PR, I just need to make sure that this does not exist in the current laravel version and that the community likes the idea.
Beta Was this translation helpful? Give feedback.
All reactions