Laravel Gripes

Only a couple of weeks into Laravel and trivial but feels like it doesn’t support – for want of a better phrase, pythonic syntax. I’m more lines of code than I would in Ruby or Python oh and there are lots of types of arrays… you have to declare it’s an array also! $myArray =… Read More »

Helper methods in Laravel

Rails gives you a great helper framework for each controller, allowing you to keep the logic out of the view, wanting to replicate but looks like Laravel takes a different approach. First create a helper file in the root of the app $ touch helper.php Now add the following namespace App\Helpers; class Helper { public… Read More »

Partials in Laravel

As a rails developer you have DRY (Don’t Repeat Yourself) drilled into you from the outset – and one of the great tools are partials. No doubt just scratching the surface with Laravel and navigating my way around partials.I tend to have a shared directory for cross app reusable code, so created the directory and… Read More »

Static Pages

There’s pretty much always a need to some standard static pages and I usually create a home, about, contact (with form), FAQ and blog The rails command for this is $ rails g controller Pages home about contact faq blog Translating to laravel we have $ php artisan:make controller Pages We don’t have the capability… Read More »

GCP | My First VM

Launch a new Virtual Machine by heading to Compute Engine > VM Instances. Hit create and you’ll be greeted with a few options. If you’re keeping in within the free trial, the g1-small will suffice and won’t push you over your limit. You should then be redirected to the instance list and you should see… Read More »

Adding Public Key to GCP

The following is OSX related, sorry windows users… you’re on your own! I’m assuming you already have your Public & Private keys set up, if not head to the terminal and type $ ssh-keygen -t rsa You’ll then need to copy the public key to your clipboard, so again in the terminal type $ pbcopy… Read More »

Docker Cheatsheet

Create and run a docker container with default command (optional) $ docker run <container> <start up command> Docker run is actually 2 command: docker create + docker start docker create – Creates container from imagedocker start – starts container from id See all containers running on your machine $ docker ps To see all containers… Read More »

Postgresql with Laravel

I love Postgres and it comes out the box with Rails however it took some configuring in Laravel. Open up your project in your favourite code editor. Head to the config folder then open the database.php file First off tell the application to use postgresql as the database by changing ‘default’ => env(‘DB_CONNECTION’, ‘mysql’) to… Read More »