Sindbad~EG File Manager

Current Path : /proc/self/cwd/common/Tags/
Upload File :
Current File : //proc/self/cwd/common/Tags/HandlesTags.php

<?php namespace Common\Tags;

use Common\Tags\Tag;

trait HandlesTags
{
    /**
     * @param string $tag
     * @param array $ids
     */
    public function addTag($tag, $ids)
    {
        $tag = Tag::where('name', $tag)->first();

        $tag->files()->attach($ids);
    }

    /**
     * @param string $tag
     * @param array $ids
     */
    public function removeTag($tag, $ids)
    {
        $tag = Tag::where('name', $tag)->first();

        $tag->files()->detach($ids);
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists