public function vartovar($vid, $tid) { $variant = $this->variant->find($vid); //$variant = $this->variant->find($vid); $count = $this->variant->countvariables($vid); if ($count) { $variables = $this->variant->formType($vid); } else { $variables = $this->variant->selectFromTemplate($tid, $vid); } $title = $variant->title; $minmax = $this->variant->hiddenfield($vid); return View::make('variants.variables', compact('variables', 'variant', 'title', 'minmax')); }