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. Excel: (Download) TXT Flat File: (Download)
Here’s a base Eloquent Repository.
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. Will output the prefix for the current database. This will work in laravel 4.
In order to get the base directory of a laravel 4 install you’ll just need to do one command. It’s fairly simple.
The environment is based on url matches. You’ll find that configuration in /bootstrap/start.php Now say you are developing locally and use the prefix/postfix local. E.g: my-new-site.local or local.my-new-site That sets the environment, now to use it you’ll need to create a local folder in /app/config/ And so you want to have a different database configuration Read more about How to set Laravel 4 environments[…]
In order to run a custom command from the command line utility called artisan you need to do two things: Create a new CustomCommand file Register that command with artisan Here’s a sample Command file called FooCommand.php which should be placed in app/commands/ Then you’ll need to register that in app/start/artisan.php Now you can run your Read more about Add a command file to Laravel artisan[…]
Typically when Laravel 4 artisan is run from the command line (cli) it uses the production configuration files. This can be changed by using a flag when running the command. However, adding –env-=local each time while running a script can slow down development. I would recommend adding your development environment hostname to the config file. To Read more about How to set local environment as default in command line (CLI) for Larvel 4 artisan[…]
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 but don’t quite fit in Read more about How to add a library folder to Laravel 4[…]
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/
An easy way to set up composer globally is to follow the instructions on getcomposer.org site: Now I can use composer by invoking just the composer command. Optional way to do it, is to set up an alias: