Laravel

From Leo's Notes
Revision as of 23:18, 31 May 2015 by 10.1.1.3 (talk)
This page was last edited on 31 May 2015, at 23:18.

Installation

The composer command is an alias in the shell that executes `php composer.phar`. Similarly, artisan executes `php artisan`.

New Project

composer create-project laravel/laravel projectname --prefer-dist

To clear the scaffolding that comes with the clean install:

artisan fresh

You can see what packages and dependencies were installed by running:

composer show -i


Usage

Views

Forms

Pull in the illuminate/html package.

composer require illuminate/html

Add the service provider to your config/app.php provider list and create a new facade.

'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',

In the blade templates, you can now use:

{!! Form::open() !!}}
  {!! Form::label('name', 'Name:') !!}}
  {!! Form::text('name', 'default', ['class' => 'blah'] ) !!}}
{!! Form::close() !!}}