How can we read the content of html file which is stored in views folder in laravel?

- 1 answer

Ad

I am trying to load the html file stored in views folder in laravel. I just want to get the path of that html so that I can read the content.

Is there any way to do this?

for a workaround am storing that html file in storage folder and reading the html content. But as I said this is just a workaround for me.I need to store that in views.

Ad

Answer

Ad

If you want to just get the html content of a view, you can simply do:

$html = View::make('your_view');

While, if you want to get the content of a json file (as you've asked in the comments), you should put it in the storage folder and get its content with:

$content = Storage::get('file.json');
Ad
source: stackoverflow.com
Ad