one(File::class, dependencyAttributes: ['withImage' => true]); $collection = Collection::find($file->collection_id); $w = rand(10, 2000); $h = rand(10, 2000); $canv = rand(0, 1); $response = $this->loginAs()->getJson(route('api.files.show', ['collection_name' => $collection->name, 'uuid' => $file->uuid, 'extention' => $collection->ext, 'w' => $w, 'h' => $h, 'canv' => $canv])); $response->assertOk()->assertHeader('content-type', $response->headers->get('content-type')); } }