Articles tagged with #php




Array list of all timezones

I needed an array of all the timezones so I could insert it in to a database seeder. So I created one off a list from wikipedia. \$timezones = array( array('abbr'=>'BIT', 'name'=>'Baker Island Time', 'utc'=>'UTC-12'), array('abbr'=>'NUT', 'name'=>'Niue Time', 'utc …



How to get laravel database prefix

I needed to get the db prefix for a raw insert query I was running. It's an easy function call to get the current database prefix. DB::getTablePrefix(); Will output the prefix for the current database. This will work in laravel 4.



How to add a library folder to Laravel 4

I typically use a library folder in my projects to group of files that you want to use in different projects but don't want to use Satis to manage the contained files. This folder could also be a helper folder for functions that are static and are mainly generic helpers …



Laravel 4 Documentation

Yesterday I was in search of Laravel 4 documentation. I couldn't figure our where to find Laravel 4 documentation. I found the committed files on GitHub but I couldn't find the actual site that hosted it. Turns out it was in a now obvious place. http://four.laravel.com/



Clear Laravel 4 Autoload

Laravel 4 currently has a very frustrating issue. If you add a model it will not know of it until you clear the autoload. [ps]composer dump-autoload[/ps] Make sure you have setup composer to be accessed globally. Otherwise you'll need to do this command. [ps]/usr/local/bin/composer …



Setting up Composer globally for Laravel 4

An easy way to set up composer globally is to follow the instructions on getcomposer.org site: [ps] \$ curl -s http://getcomposer.org/installer | php \$ sudo mv composer.phar /usr/local/bin/composer [/ps] Now I can use composer by invoking just the composer command. Optional way to do it …