Laravel

A wrapper around Laravel framework for PHP. Currently, is only capable of downloading Laravel source from a local directory, some git based (online/offline) repository or from the official source on Github. Still in development.

Code
Climate | Dependency
Status | Build Status

Installation

Add this line to your application's Gemfile:

gem 'laravel'

And then execute:

$ bundle

Or install it yourself as:

$ gem install laravel

Usage

Create a new Laravel application

Laravel gem has a caching mechanism in-built, which allows to keep a local copy when you use a repository for the first time. After this, whenever you use that repository again, it will only update the local copy of the repository (as opposed to a fresh git clone, which is considerably slow for certain connections). This will, allow you to install Laravel applications even when you are not connected to the Internet.

Since, you can specify which git repository to use to fetch the Laravel source, you can create new Laravel application based on your own or someone else's fork of Laravel, if required. And, yes! These repositories will be cached!

# use default settings (fetches source from http://github.com/laravel/laravel.git)
laravel new my_app
laravel new my_app --[no-]force # force overwrite
laravel new my_app --[no-]perms # (default) make "storage" directory world-writable

# use a specified repository
laravel new my_app --sourec=./src/laravel  # relative directory
laravel new my_app --source=/usr/src/local # absolute directory
laravel new my_app --source="http://github.com/user/my_laravel_fork # a git repository

Create a customized Laravel application

When creating a new Laravel application, we can define configuration settings using the '--config' flag. We can pass a comma-separated list of setting:value pairs, like the following. Note that, you can generate a new application key by, simply, passing key instead of key:some_fixed_key.

# generate a new key, set index to empty and turn on the profiler
laravel new my_app --config=key,index:'',profiler:on

# use a key, set index to "home.php", and update application's language to 'hi'
laravel new my_app --config=key:fixed_string,index:home.php,language:hi

# the settings I use:
laravel new my_app --config=key,index:''
## this creates a Laravel application from the official repository,
## sets the Application Index to blank, makes the storage directory
## world-writable, generates a new key for the application.
## Furthermore, this creates the local cache for the official repository
## which makes the future installs quite faster :)

In an existing Laravel application

# update Application Index for the application
laravel config update index ''  # removes application index for app in current directory
laravel config update index 'home.php' --app=./new_app # update for app in specified directory

# generate a new key for the application
laravel config update key # generates key for app in current directory
laravel config update key 'fixed_string' --app=./new_app # set a key for app in specified directory

Help

laravel help

Coming Soon..

# create and customize a new Laravel application
<del>laravel new my_app --config:index=''           # set application index to blank</del>
<del>laravel new my_app --config:key                # generate a new key</del>
laravel new my_app --[no-]generator     # download the Laravel Generator by Jeffrey Way
laravel new my_app --database=db_my_app # create a database, defaults to app name

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Testing

Note that, the tests for this gem can be really slow, since we download repositories from github for properly testing the gem. Moreover, running the test suite will download the official Laravel repository in the local cache, thereby, speeding up creation of new applications.