is it possible with Laravel (latest) to generate an css file "on the fly" from custom css code from the database?
I've stored the custom css code in "custom_css" (longtext) in my mysql db.
I just thought that I could output it via blade:
<style type="text/css">{{$custom_css}}</style>
But isn't there a possibility to generate a css "on the fly" and add it via link-tag?
Adding it via blade could extend my html code, I don't want that. I want a clean "html" (as much as possible).
Thanks!
Given your comments:
Route::get('/path/to/css', function() {
// fetch your CSS and assign to $contents
$response = Response::make($contents);
$response->header('Content-Type', 'text/css');
return $response;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With