Wrote a method in Controller.php
public function customView($viewPath, $viewArr)
{
$amp = Request::input('amp');
if ($amp) {
return view('amp.' . $viewPath, $viewArr);
} else {
return view($viewPath, $viewArr);
}
}
and from other controllers returned something like this :
return $this->customView('home',$viewArr);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community