Yes, an exists() method is available.
if(view()->exists($view)){ return view($view)->render();}return "Page tidak ditemukan";
Yes. Using the View facade.
View
// Return true when welcome.blade.php does not exist in theview folderView::exists('welcome'); // Return false when login.blade.php does not exist in the view folderView::exists('login');
try { return view($view); } catch (\Exception $e) { return "Page tidak ditemukan"; }
will be more efficient way