/** * Handle the command. */ public function handle() { if (!$this->builder->getStream()) { $parts = explode('\\', str_replace('AssignmentTableBuilder', 'Model', get_class($this->builder))); unset($parts[count($parts) - 2]); $model = implode('\\', $parts); $this->builder->setStream(app($model)->getStream()); } }
/** * Return an index of existing assignments. * * @param AssignmentTableBuilder $table * @param TypeRepositoryInterface $types * @param $type * @return \Symfony\Component\HttpFoundation\Response */ public function index(AssignmentTableBuilder $table, TypeRepositoryInterface $types, $type) { /* @var TypeInterface $type */ $type = $types->find($type); return $table->setStream($type->getEntryStream())->render(); }
/** * @param AssignmentTableBuilder $table * @param StreamRepositoryInterface $streams * @param DiskRepositoryInterface $disks * @param $id * @return \Symfony\Component\HttpFoundation\Response */ public function index(AssignmentTableBuilder $table, StreamRepositoryInterface $streams, DiskRepositoryInterface $disks, $id) { /* @var DiskInterface $disk */ $disk = $disks->find($id); return $table->setStream($streams->findBySlugAndNamespace($disk->getSlug(), 'files'))->render(); }