title: Add Tags to Laravel Built Blog
body: <p>I built a blog with Laravel, but I haven't figured out how to add tags to it. I would like to avoid using packages. Here is the code I have so far: </p>
  
  <p>TagsController -</p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Tag;
  use Illuminate\Support\Facades\Storage;
  use Illuminate\Support\Facades\Session;
  
  class TagsController extends Controller
  {
  public function index() {
      $tags = Tags::paginate(4); 
      return view('dashboard/tags/index', compact('tags'));
  
  }
  
  public function create() {
      return view('dashboard/tags/create');
  }
  
  public function store() {
      $tags = new Tags;
  
      $tags-&gt;name= $request-&gt;input('name');
      $tags-&gt;save();
      Session::flash('flash_message', 'Tag successfully added!');
      return Redirect('/dashboard/tags');
  }
  }
  </code></pre>
  
  <p>Tag Model</p>
  
  <pre><code>namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Tag extends Model
  {
  public function posts()
  {
      return $this-&gt;belongsToMany('App\Post');
  }
  }
  </code></pre>
  
  <p>I'm not sure how to add more than one tag, so I can put it on the posts. </p>
  
  <p>I'm on Laravel 5.3.</p>