/**
  * Attach the resource categories, tags and misc
  * variables to the necessary views.
  */
 private function attachResourceFields()
 {
     View::composer('resources._form', function ($view) {
         $view->with(['categories' => ResourceCategory::orderBy('name', 'ASC')->lists('name', 'id'), 'tags' => ResourceTag::orderBy('name', 'ASC')->lists('name', 'id'), 'access' => Resource::getAccessList()]);
     });
     View::composer(['resources.index', 'resources.list', 'resources.partials.search_inputs'], function ($view) {
         $categories = ResourceCategory::orderBy('name', 'ASC')->get();
         $tags = ResourceTag::orderBy('name', 'ASC')->get();
         $view->with(['all_categories' => $categories, 'all_tags' => $tags]);
     });
 }
 /**
  * View all the existing tags (tabulated).
  * @return mixed
  */
 public function index()
 {
     $tags = ResourceTag::orderBy('slug', 'ASC')->paginate(20);
     return View::make('resources.tags.list')->with('tags', $tags);
 }