This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

e.d.wijninga10612
e.d.wijninga10612

Hello all. I have followed the demo for the todo list plugin (in my case an event plugin), however, it does not show how to delete to items from the list.

I have already found the onDelete and request confirm for the button and made the public function onDelete, but I have no idea how to move on from there.

I hope you guys can help me out or show me where to find the documentation.

dshoreman
dshoreman

Check the Eloquent docs for Laravel, and you'll find out what you can do with the models. In particular, you'll want to check the deleting models section, which shows you a few ways to do it.

e.d.wijninga10612
e.d.wijninga10612

Thanks dshoremen, that send me in the right way.

However, now I run into another problem, which might be due to my inexperience with Laravel.

I want to delete the entry where the id meets the id in the html item. To do that, I have to add the id to the html element, like so:

  • Now I ran into the problem I can't get {{ id }}, {{ date }} and {{ description }} to fill. First I did this: $this->events = Event::lists('title'); $this->title = Event::lists('title'); $this->id = Event::lists('id'); $this->date = Event::lists('date'); $this->description = Event::lists('description'); But that gives me several one dimensional arrays. This is how events.htm looks: {% for event in events %}
  • 1-3 of 3

    You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.