Example #1
0
 public function get($guid)
 {
     $asset = $this->assetsManager->assetOfGuid($guid);
     $path = $this->realPath($asset->path());
     $image = Image::make($path);
     return $image->response();
 }
Example #2
0
 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);
     }
 }
Example #3
0
 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']);
 }
Example #4
0
 /**
  * @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);
 }