Ejemplo n.º 1
0
 public function testMagicMethodsCanBeUsedToSetAttributes()
 {
     $fluent = new Fluent();
     $fluent->name = 'Taylor';
     $fluent->developer();
     $fluent->age(25);
     $this->assertEquals('Taylor', $fluent->name);
     $this->assertTrue($fluent->developer);
     $this->assertEquals(25, $fluent->age);
     $this->assertInstanceOf('Laravel\\Fluent', $fluent->programmer());
 }
Ejemplo n.º 2
0
 /**
  * Generate the SQL statement for creating a primary key.
  *
  * @param  Table    $table
  * @param  Fluent   $command
  * @return string
  */
 public function primary(Table $table, Fluent $command)
 {
     return $this->key($table, $command->name(null), 'PRIMARY KEY');
 }