Support the ongoing development of Laravel.io →
Eloquent Views Blade
Last updated 2 weeks ago.
0

Use File::put('file.xml', $file_contents) which is basically a wrapper for PHP's file_put_contents(). Also you need to call the render() method on the view to get the content as string.

$content = View::make('xml.index', $data)->render();

File::put(storage_path().'/file.xml', $content);

return Response::make($content, 200)->header('Content-Type', 'application/xml');
Last updated 2 weeks ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

damonsharp damonsharp damonsharp Joined 14 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.