Drupal Code Linting with Sublime Text, PHPStorm and VSCode

Publié le 05/02/2018 | #drupal , #php
Using ZSH? Create a .zprofile with this: export PATH=$HOME/.composer/vendor/bin:$PATH Getting CodeSniffer and Drupal Coder Install code sniffer v2.7 globally with composer (see this issue): composer global require squizlabs/php_codesniffer Install drupal/coder globally with composer: composer global require drupal/coder Register the Drupal and DrupalPractice Standard with PHPCS: phpcs --conf...

Search for your github stars with Alfred

Publié le 20/01/2016 | #github , #alfred
As part of my web development activity I find myself constantly referencing the Github repositories of libraries used in my current project. I also got into the habit of starring every repo that I’m using as it is quite convenient to filter out the bazilion Github repositories by going to the dedicated Your stars page. As an avid user of Alfred, the next logical step is to make use of the awesome...

A Laravel factory with starting and ending dates

Publié le 04/01/2016 | #laravel , #php
Laravel provides a convenient way to seed your database with fake data for testing purpose using a system of factories for your Eloquent models. vh This is a demonstration of how to create a factory for a model that is using starting and ending dates, like a Workshop model for example. First we need a starting date that would be useful for the tests: one that’s not already past and yet not too far...

Detect and change language on the fly with Laravel

Publié le 19/11/2015 | #laravel , #php
If you’re builiding a multilingual site you may want to guess the user’s language in order to provide the correct content and still let her decide afterwards which language to use. So this a is two part problem: Find a way to detect the user’s native language and tell Laravel to use it Provide a way for the user to change it and store that choice in session This tutorial will not cover...

Automatic password resets with Laravel

Publié le 06/10/2015 | #laravel , #php
I’ve recently had to implement a way to force the registred users of a Laravel 5.1 application to change their passwords after a given period. It’s not a very good security measure if you ask me because of the burden it puts on the users: an effective security policy is a necessary trade-off between ease of use and things like password complexity. But if you ever need to implement such functionnal...

6 astuces pour les Collection dans Laravel

Publié le 30/05/2015 | #laravel , #php
Jeff Madsen présente six astuces très utiles si vous travaillez avec Laravel et notamment son excellent ORM, Eloquent. La prochaine fois que vous avez à faire un <select> dans un formulaire, n’oubliez pas celle-ci (modifiée pour Laravel 5.1) : $engineer = $collection ->where('type', 'engineer') ->lists('first_name') ->all(); Voir les autres as...