Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     Schema::create('authors', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
     });
     Schema::create('books', function (Blueprint $table) {
         $table->increments('id');
         $table->string('title');
     });
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     Schema::create('books', function (Blueprint $table) {
         $table->increments('id');
         $table->string('title')->unique();
         $table->integer('author_id')->nullable();
         $table->foreign('author_id')->references('id')->on('authors');
     });
     Schema::create('authors', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name')->unique();
     });
     Model\Book::observe(new \Ormic\Observers\Datalog());
     Model\Author::observe(new \Ormic\Observers\Datalog());
 }