public function get($guid) { $asset = $this->assetsManager->assetOfGuid($guid); $path = $this->realPath($asset->path()); $image = Image::make($path); return $image->response(); }
public function createAssets() { $klimtoren = $this->getKlimtoren(); for ($i = 0; $i < 10; $i++) { $image = $this->getImage($i, 'jpg'); $asset = $this->assetsManager->upload($image, $klimtoren->id()); unset($this->file); } }
public function importUrl(Request $request, $orgId = null) { if (!$request->get('url')) { throw new \InvalidArgumentException('URL nog set'); } $url = $request->get('url'); $type = $request->has('type') ? $request->get('type') : null; $orgId = $request->has('organization') ? $request->get('organization')['id'] : null; $asset = $this->assetsManager->import($url, $orgId, $type); return $this->jsonResponse($asset, ['detail']); }
/** * @test * @group assetsmanager */ public function should_throw_org_not_found_on_assets_of_type() { $this->setExpectedException('Bakgat\\Notos\\Domain\\Model\\Identity\\Exceptions\\OrganizationNotFoundException'); $orgId = 999999; $mime_part = 'image'; $this->orgRepo->shouldReceive('organizationOfId')->with($orgId)->andReturn(null); $result = $this->assetsManager->assetsOfMimePart($orgId, $mime_part, null); }