public function files($id) { if ($this->isAdminRequest()) { //Get File Categories $filecategories = array('' => 'Choose a Category') + FileCategory::lists('file_category_name', 'id'); $productcategory = ProductCategory::find($id); return View::make('admin.products.files')->with('productcategory', $productcategory)->with('filecategories', $filecategories)->with('files', $productcategory->files)->with('imgexts', array('jpg', 'png', 'gif')); } }