Comments (4)
I was unfamiliar with the $this->validateWith()
method. I did not know it existed which is the simple reason i have not used it. I will probably incorporate that soon. It is a nice little shortcut. It always felt dumb manually adding the $request
into it since that is what you are validating 99% of the time.
I get asked about Mass assignment a lot. The reason I don't use it is simple. Because I teach this stuff so much (both online and locally) i generally avoid teaching newcomers about mass assignment. Newcomers don't do well with "magic" methods that do a lot of hidden work behind the scenes. So showing them manually setting them is good so they can see how it works. There are also times when you really don't want to do mass assignment (or you need to put in some more complex work to make it work) such as when you are filling in non-mass-assignable fields. So i have moved away from teaching mass assignment to beginners, because it is a major point of confusion for them and makes teaching something like saving a new record in the database take a day instead of an hour.
Because much of my coding is teaching, and because i avoid teaching it, I have gotten out of the habit of using mass assignment even in personal projects. I don't hate mass assignment, i have nothing against it, and I agree it is far more elegant. But like I said the teaching methods I do so often get engrained as habit for me and eventually bleed over into my more personal projects. Behind the scenes mass assignment is doing the same thing I am doing manually, so it doesn't save on things like performance. Just cleanliness of the controllers.
If you wanted to work on it and submit a PR i would look it over and likely approve it. Now is a good time since we have now completed Permission
and Role
. We also will probably not add anything to the User
model for another week or so. So its a good time to make those changes.
Thanks for contributing
from devmarketer.
Hey @jacurtis!
Can I submit some refactored code (I've already submitted one (#5)), as now this project is in Laravel's 5.5 version? Or no, wait until the series end?
from devmarketer.
It is now in version 5.5. Go ahead and submit the code and ill review it.
from devmarketer.
Ive approved the changes in PR #5. Ill close this for now. Open up a new issue or pull request if you have other changes. THanks
from devmarketer.
Related Issues (20)
- [Task]: Conditionally set onclick event for adminSlideButton
- [Task]: Create README HOT 1
- [TASK]: Setup flash message reminders HOT 1
- [Task]: Additional Things to Add to Slug Component HOT 3
- If a user edits a slug, then starts and cancels the edit again, this will reset the wasEdited feature back to false (should stay true)
- [TASK]: Email Users Their Password Upon Creation HOT 3
- [Task]: Before confirming Slug, Check to see if Unique
- [TASK]: Add WYSIWYG Editor to Posts.Create HOT 3
- Role based Middleware issue HOT 1
- Can't open the login or even register. No page found.
- Minor bug
- Empty Roles HOT 1
- marked current permissions HOT 1
- 404 when stripping user from roles on edit HOT 1
- Install this project on my xampp HOT 2
- profile
- Post edit
- Observer not working HOT 3
- I have a really bad mistake please help me. Plz HOT 1
- Superadministrator password HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devmarketer.