Skip to content
Advertisement

Laravel, function create and edit, retrieve data from tags

I have a basic article and tag system, with a Many to Many relationship. I manage to display all tags in the create function but I don’t know how to display all tags and tags checked in the edit function.

Article :

JavaScript

Tag :

JavaScript

function create :

JavaScript

function edit

JavaScript

form

JavaScript

really need help pls, it’s for a school project. and sorry for my english… create: screen for add an article edit : screen for edit an article

Advertisement

Answer

here I found it ! just needed a second foreach

JavaScript

and in the create $tags= Tag::all();

thanks for the help anyway ^^

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement