If you want create your own text file, HTML file, CSS file, PHP file, JSON file, etc in Laravel. then we do not need to use any PHP library or Class because Laravel Framework Provides its own "File" Facade. File Class through you can create your own HTML file, text file, PHP file, etc as you want. File Facade Class also provides several functions as you can create the file, remove the file, update the file etc. now I am giving you an example of how to create a JSON file in Laravel. 

Route :

Route::get('downloadJSONFile', array('as'=> 'downloadJSONFile', 'uses' => 'JSONFileController@downloadJSONFile'));

JSONFileController Controller :

namespace App\Http\Controllers;
use View;
use File;
use Response;
class JSONFileController extends Controller
	public function downloadJSONFile(){
	  $data = json_encode(['Example 1','Example 2','Example 3',]);
	  $fileName = time() . '_datafile.json';
	  return Response::download(public_path('/upload/jsonfile/'.$fileName));

I hope this will help you.