Closed barryvdh closed 10 years ago
To address your questions: 1) yes, the input doesn't need to be escaped, I just use that based on some bad experience I had with anything user-driven and user-submittable. 2) You're right, I forgot to mention about the particalar fork of Nestable, I had to search through lots of pull requests on that project to get the desired result. I now created a fork with the proper modifications: https://github.com/msurguy/Nestable 3) Definitely could be done, I just want to make my tutorials so simple and adaptable to other things that developers could see the process before packaging everything in a tiny little box that they could only see from the outside. I like to leave things in-progress for them to learn from it. This by no means is the final version that they should have in their product. 4) Actually I disagree with naming actions/routes. I haven't used it at all since I started with Laravel abt 2 years ago. In my opinion it doesn't help much to use named routes. (this is something that we just have to disagree on)
https://github.com/tchapi/Nestable I'd love to have the noChildrenClass from this fork with yours, but I can't seem to get it together.
Did it in the controller, never mind. Allows no children to be assigned for that category which is exactly what I was looking for.
public function postIndex()
{
$source = e(Input::get('source'));
$destination = e(Input::get('destination', 0));
if($destination == 1) return false;
@mack-hankins Very cool!
Hey, Thanks for the example code. I did it somewhat similar, but instead of dropping, just use a save button and serialize/save the entire form at once, and created a Twig macro for menu builder :)
I just have a few remarks/questions:
e(Input::get('order'))
. But isn't this unneeded because of Laravels ORM? Isn't it more logical to escape when displaying data?url('admin/menu/etc')
). Doesn't matter that much, but when you are creating a tutorial, might as well use best practices.