photo module
This commit is contained in:
@ -81,12 +81,14 @@ class TagModule extends Module
|
||||
TagEntity::where("entity", $entity)->where("entity_id", $model->id)->delete();
|
||||
|
||||
$tags = $request->post("tag");
|
||||
foreach ($tags as $tag) {
|
||||
$tagEntity = new TagEntity();
|
||||
$tagEntity->entity = $entity;
|
||||
$tagEntity->entity_id = $model->id;
|
||||
$tagEntity->tag_id = $tag;
|
||||
$tagEntity->save();
|
||||
if (is_array($tags)) {
|
||||
foreach ($tags as $tag) {
|
||||
$tagEntity = new TagEntity();
|
||||
$tagEntity->entity = $entity;
|
||||
$tagEntity->entity_id = $model->id;
|
||||
$tagEntity->tag_id = $tag;
|
||||
$tagEntity->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user