Repository

Introduction

Table repositories are used to create an entry when creating and to update an entry when editing. The repository is guessed based on the type of model used.

Custom repositories are a rare need.{.note}

If you would like to or need to define the repository yourself you can do so on the table builder.

protected $repository = \Example\Test\FancyTableRepository::class;

You can also set an instantiated repository on the builder dynamically:

$builder->setRepository(app(MyTableRepository::class);

The table repository must implement \Anomaly\Streams\Platform\Ui\Table\Contract\TableRepositoryInterface and implement the following method:

/**
 * Get the table entries.
 *
 * @param  TableBuilder $builder
 * @return Collection
 */
public function get(TableBuilder $builder);