Route::get('/robots.txt', function(){
$settings = \App\Block::where('kind', 'robots.txt')->first();
$fileText = $settings->code;
$headers = ['Content-type'=>'text/plain','Content-Length'=>sizeof($fileText)];
return Response::make($fileText, 200, $headers);
});
Route::get('/robots.txt',function(){
return response()->streamDownload(function () {
echo \App\Block::where('kind', 'robots.txt')->first()->code;
}, 'robots.txt', ['Content-Type'=>'text/plain'],'inline');
});