Thoughts, etc.

Tracking the occasional random walk

notes

Getting a Faker instance in Laravel’s tinker environment

2018-05-03 / 3 Comments

I sometimes find that it would be useful to use  artisan tinker to play with the sorts of data that Faker will generate in a Laravel factory. Unfortunately I don’t do it often enough to always remember the correct way to do it, since the obvious  new Faker\Generator doesn’t work. So for future reference, what you need is:

1
>>> $faker = Faker\Factory::create();

 

Posted in: snippets Tagged: laravel, notes

Ember’s live reload server doesn’t live reload addons

2017-03-13 / Leave a Comment

The title pretty much says it all on this one. I just started playing around with Ember, and one of the first things I tried to do was include the ember-simple-auth addon in a brand new project. I tried following the step-by-step instructions in the readme as well as the ones shown in the introductory video. Nothing … [Read more…]

Posted in: Uncategorised Tagged: ember, notes

Long-running PHP process on nginx

2016-12-13 / Leave a Comment

Recently I had to allow a PHP script to run for several minutes under Nginx (more specifically, as part of a Laravel app on a DigitalOcean server), after encountering the error “504 Gateway Timeout”. First, to tell Nginx to allow the script to run for a longer period of time, I set the FastCGI read timeout to ten … [Read more…]

Posted in: system Tagged: nginx, notes, php

Adding many-to-many joins in CakePHP with newEntity

2016-11-26 / Leave a Comment

To allow CakePHP 3 to add entries to many-to-many join tables when creating or patching entities, the names of the associations must be added to the array of accessible concrete properties on the model. The documentation does mention this fact eventually, as a note in the “Patching HasMany and BelongsToMany” section, but not as part of … [Read more…]

Posted in: code Tagged: cakephp, notes

Laravel 5.1 “intermediate quickstart” notes

2015-12-16 / Leave a Comment

I just ran through Laravel’s intermediate quickstart tutorial. On the whole it was rather well put together and worked with as little or as much copying and pasting as you felt like using. Here I’m just recording a few notes for future reference about non-obvious things I encountered. Error messages for simple typos One interesting … [Read more…]

Posted in: code Tagged: laravel, notes