コード例 #1
0
ファイル: ComponentTest.php プロジェクト: typecms/core
 /** @test **/
 public function it_fetches_the_field_of_the_component()
 {
     $this->createComponent('pages', function ($component) {
         $component->string('title');
     });
     $component = Component::byName('pages');
     $this->assertEquals('title', $component->field('title')->name);
 }
コード例 #2
0
ファイル: Builder.php プロジェクト: typecms/core
 /**
  * Open a connection to the component.
  *
  * @param  string  $name
  * @return Component
  */
 private function openConnection(string $name)
 {
     return EloquentComponent::byName($name);
 }