lundi 1 février 2016

Laravel - How Can I Render a View With Artisan?

I'm using some blade based JS in my project and need to get it into my bundle being produced by NPM. Right now I'm doing it by outputting the code from a route into a .js file that NPM is watching using a bit of php that gets the output using file_get_contents and the url. This works fine, but if there is a DNS issue with my Vagrant (often caused by AnyConnect, or just reloading the Vagrant while watch is running), the .js contains a PHP error complaining about not being able to reach the url, and this in turn gets packed into my bundle.js and breaks everything.

I set out to try to create an Artisan command to render the output, but I find that Artisan does not have access to 'View' class at all.

How would I give it access to that class?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire