How to check if View Exists or not in Laravel 5?

By Hardik Savani | April 12, 2016 | | 31273 Viewer | Category : Laravel


In some situations, we require to check if view exists then render view otherwise display something else. But you can perform this task using "exists" function of view helper. It will return true or false. So you can use bellow example.

Example:

if (view()->exists('users.index')) {

....

}



Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
***Do you want me hire for your Project Work? Then Contact US.