Install Laravel application in 4 steps

If you download a Laravel application (e.g. from GitHub) this doen’t contain the Laravel framework and other bundles.
You can deploy it in few steps on your development pc.

1, Use this console command at  main folder:   > composer update

2, Set database connection : /app/config/database.php

3, Use this console command at  main folder:php artisan migrate

4, Than: php artisan db:seed

 

 

 

Laravel MVC, DB::table

,

MVC in Laravel [PHP] Runnable
In Laravel MVC is easy to acomplish and feels very native.

Controller:
// get data from DemoModel.php
$data = DemoModel::getData();

Model:

class DemoModel {

static public function getData()
{
return 'Model data put me in a view please.';
}
}

Basic Join:

DB::table('users')
            ->join('contacts', 'users.id', '=', 'contacts.user_id')
            ->join('orders', 'users.id', '=', 'orders.user_id')
            ->select('users.id', 'contacts.phone', 'orders.price')
            ->get();

uninstall package in Laravel

,
  1. Remove decleration from composer.json (in “require” section)
  2. Remove Service Provider from “app.php” (reference in “providers” array)
  3. Remove any Class Alliases from “app.php”
  4. Remove any references to the package from your code 🙂
  5. Run “composer update”
  6. Manually delete the published files

IoC Container

,

The Laravel inversion of control container is a powerful tool for managing class dependencies. Dependency injection is a method of removing hard-coded class dependencies. Instead, the dependencies are injected at run-time, allowing for greater flexibility as dependency implementations may be swapped easily.

Understanding the Laravel IoC container is essential to building a powerful, large application, as well as for contributing to the Laravel core itself.

http://laravel.com/docs/ioc

Best Laravel Packages

Best Laravel Packages to speed up development

“league/fractal”:
Presentation and transformation layer for complex data output such as RESTful APIs.

“laravelbook/ardent”
Self-validating smart models for Laravel Framework 4’s Eloquent ORM.

“mockery/mockery”
“codeception/codeception”
Unit testing & Full Stack Testing great for TDD.

“fzaninotto/faker”
PHP library that generates fake data for your project.

“facebook/xhprof”
Light-weight hierarchical and instrumentation based profiler.

“barryvdh/laravel-ide-helper”
Laravel IDE Helper, generates correct PHPDocs for all Facade classes.

Changes For Laravel 4.2.*

,
$php artisan changes

-> View and Pagination ‘Environment’ classes renamed to ‘Factory’.
-> Configurable encryption for Iron.io queue messages.
-> Make FrameGuard middleware opt-in.
-> Convert View ‘$errors’ shared variable into ViewErrorBag. Allows multiple bags per view. Should be backwards compatible.
-> Calling ‘create’ on a HasOne or HasMany relation will now use ‘fill’ method so mutators are executed on related model.
-> Use rawurldecode when decoding parameters in Route::parameters.
-> When date_format validation rule is used, before and after validation dates must match given format.
-> Added ability to register global Eloquent scopes using traits and addGlobalScope.
-> Soft deleting converted to use new global scope facilities.
-> Added ability to extend Eloquent Builder using ‘macro’ method.
-> Soft deleting models now use SoftDeletingTrait instead of softDelete property.
-> The queue:listen command will now write the names of the jobs it processes to the console.
-> Added Mailgun API transport for Mail::send. Depends on new ‘services’ configuration file.
-> Added Mandrill API transport for Mail::send. Depends on new ‘services’ configuration file.
-> Added ‘log’ mail transport for Mail::send. Writes raw MIME string to log files.
-> Added simplePaginate method to query and Eloquent builder.
-> Destructive migration operations now require confirmation or –force when being run in production.
-> Added Cache::pull method for retrieving a value and then deleting it.
-> Added Session::pull method for retrieving a value and then deleting it.
-> Added rel attribute to basic pagination links.
-> The ‘page’ query variable is now ignored when calling the paginator ‘appends’ method.
-> Empty arrays that are ‘required’ validate as false when empty.
-> Added –daemon option to the queue:work command.
-> Added convenient traits for authentication and password reminding.
-> Added ‘reject’ method to Collection.
-> Added ‘updateOrCreate’ method to Eloquent model.
-> Added ‘keyBy’ method to Collection.
-> Added ‘contains’ method to base Collection.
-> Allow ‘where’ route constraints to be passed in array definition of Route.
-> Properly support Route ‘where’ constraints on a Route group.
-> When ‘increment’ or ‘decrement’ is called on a single Model instance, the local attribute value is updated as well.
-> Automatically retry queries on database connections that have ‘gone away’.