Setting up a Laravel app on Docker

Rough notes, will pull this togther in a blog post at later date. issue: The requested URL /login/ was not found on this server. resolution: add to manually enable mod rewrite on command line in the container: # launch a terminal in the container docker exec -it e39431779799 bash # enable modrewrite a2enmod rewrite /etc/init.d/apache2 … Read more

Adding javascript functions to Laravel Mix ( and why you get error Uncaught ReferenceError: function is not defined )

This one had me pulling my hair out the other day. I was using Laravel,  adding a javascript function to the app.js file ( also tried using require in app.js and pulling in my function ). Laravel uses Laravel Mix which is a wrapper for webpack. Yet with either approach I was getting the javascript … Read more

Laravel how to set a checkbox value to checked based on models value

In this post I’ll show how to set a Laravel checkbox value to checked based on the value stored on the model. In this example I’ll be using the Laravel Collective Form checkbox {{ Form::checkbox(‘collected’ /* name */, “yes” /*value*/, old(‘collected’, $gas_cert->collected==”yes”?true:false ) /* true sets checked */ ) }} In the code example above … Read more