2017 © Pedro Peláez
 

library sql-view

Create SQL view

image

thibaud-dauce/sql-view

Create SQL view

  • Wednesday, July 30, 2014
  • by ThibaudDauce
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SQLView

Build Status Software License, (*1)

Introduction

SQLView package allows you to easily create view for your database., (*2)

Installation

PHP 5.4+ and Laravel 4.2+ are required., (*3)

To get the latest version of SQLView, simply require "thibaud-dauce/sqsl-view": "0.*" in your composer.json file. You'll then need to run composer install or composer update to download it and have the autoloader updated., (*4)

Once SQLView is installed, you need to register the service provider. Open up app/config/app.php and add the following to the providers key., (*5)

  • 'ThibaudDauce\SQLView\SQLViewServiceProvider'

You can register the SQLView facade in the aliases key of your app/config/app.php file if you like., (*6)

  • 'SQLView' => 'ThibaudDauce\SQLView\Facades\SQLView'

Usage

Create a migration file as usual with artisan: php artisan migrate:make add_user_view, (*7)

And then fill it like this:, (*8)

<?php

use ThibaudDauce\SQLView\Blueprint;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Migrations\Migration;

class AddUserView extends Migration {

  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    SQLView::create('user-view', function($view) {

      $query = $view->newQuery('table')->where('id', new Expression(3));
      $view->setQuery($query);
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    SQLView::drop('user-view');
  }

}

TODO: Add artisan command., (*9)

The Versions

30/07 2014

dev-master

9999999-dev

Create SQL view

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel sql migrations

30/07 2014

v0.1

0.1.0.0

Create SQL view

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel sql migrations