May 31, 2013

Install Laravel 4 and bundles.

Since the release of laravel 4, lots of developer got their hand dirty playing around with the awesome framework, What is Laravel?
Laravel is a php framework that help you write codes, faster simpler in a elegant way. See they said about themselves.

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching.

To install Laravel 4, you need to install composer first, go ahead and download from or you could use terminal
[cc lang="php"]

if ever encounter an error, most properly you are using MAMP.
[cc lang="php"]The detect_unicode setting must be disabled.
Add the following to the end of your php.ini: detect_unicode = Off

there are many solutions around, the easiest way I found is below terminal command.
[cc lang="php"]curl -s | php -d detect_unicode=Off

This will download a compose.phar file, you can copy to your Laravel project folder, then you need to download the latest Laravel copy from Laravel
then you need to install dependecy files, open your terminal again, type in "cd /your laravel project location" and enter below command
[cc lang="php"]php composer.phar install

Once installed and you are ready to develop anything, You might want to setup a virtual host to rapid your development time.
check out my another post here

Laravel 4 are depends on composer for packages which are called bundles in Laravel 3. yes there are no more install bundles command.
instead you use composer.json to install new packages.
open up composer.json
add in the package you want to install to required attribute example: "cartalyst/sentry": "2.0.*" save this file now, and open up terminal update the framework using
[cc lang="php"]php composer.phar update

When I start using the Laravel artisan command, I got an error something like mcrypt extension must be enabled which I think I already did that since I am using MAMP, to fix this problem use the command below.
[cc lang="php"]echo 'export PATH="/Applications/MAMP/bin:/Applications/MAMP/Library/bin:$(find /Applications/MAMP/bin/php -type d -name "php5.4*" | sort | tail -1)/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile