TIP 05 / 20

Does View File Exist?.

You can check if View file exists before actually loading it.

php
if (view()->exists('custom.page')) {
 // Render the view.
}

You can even load an array of views and only the first existing will be actually loaded.

code
return view()->first(['custom.dashboard', 'dashboard'], $data);