Last Updated: August 07, 2022
·
3.238K
· wolfiezero

Install Laravel 4 with Ease

If you regularly create applications with Laravel 4 then you may want to add this little function to your bash_profile. It even installs composer!

# Install laravel and configure
install-laravel () {
    echo "Installing Laravel into '$1'"

    git clone https://github.com/laravel/laravel.git $1
    cd $1

    # Required for getting L4 dev
    git reset --hard HEAD
    git checkout develop

    # Do the house cleaning
    chmod -R 0777 app/storage
    php curl -s https://getcomposer.org/installer | php
    php composer.phar install
    php artisan key:generate
    rm -rf .git
}

4 Responses
Add your response

I edited your snippet above for L3 and composer.

# Install laravel and configure
install-laravel () {
    echo "Installing Laravel into '$1'"

    git clone https://github.com/laravel/laravel.git $1
    cd $1

    # Required for getting L4 dev
    # git reset --hard HEAD
    # git checkout develop

    # Do the house cleaning
    chmod -R 0777 storage
    curl -sS https://getcomposer.org/installer | php
    php composer.phar
    touch composer.json
    echo "{
        \"require\": {

        }
    }" > composer.json
   php composer.phar install
   php artisan key:generate
   rm -rf .git
}
over 1 year ago ·

Is 777 a good practice? Shouldn't it be 755?

over 1 year ago ·

There are some Laravel hosting platforms that has 1 click installation option. If you are gonna host your app, try using such a platform. This saves a lot of time and efforts.

over 1 year ago ·

Some Laravel hosting platforms offer a one-click installation feature. If you're going to host your app, consider choosing one of these platforms. This saves a significant amount of time and work.

over 1 year ago ·