{"id":254808,"date":"2020-06-16T04:21:25","date_gmt":"2020-06-16T04:21:25","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=254808"},"modified":"2020-06-16T04:21:27","modified_gmt":"2020-06-16T04:21:27","slug":"how-to-upload-an-image-at-a-storefront-in-shopware-6","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/","title":{"rendered":"How to upload an image at a storefront in Shopware 6"},"content":{"rendered":"\n<p>In this blog, you are going to learn \u201cHow to upload an image in Shopware 6 at the storefront.\u201d<br>I hope you know the directory structure of <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\" target=\"_blank\">Shopware<\/a> 6 plugin, if you don&#8217;t know, see here- <a rel=\"noreferrer noopener\" href=\"https:\/\/webkul.com\/blog\/create-product-and-product-variant-in-shopware-6\/\" target=\"_blank\">https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/internals\/directory-structure<\/a>.<\/p>\n\n\n\n<p>Firstly, you have to create an form in html.twig file. In my case, file name is test.html.twig .<\/p>\n\n\n\n<p><strong>test.html.twig<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{% block test_from %}\n &lt;form \n action=&quot;{{ path(&#039;frontend.test.upload&#039;) }}&quot;\n method=&quot;post&quot;\n data-form-csrf-handler=&quot;true&quot;\n data-form-validation=&quot;true&quot;&gt;\n    {% block test_upload_form_csrf %}\n       {{ sw_csrf(&#039;frontend.test.upload&#039;) }}\n    {% endblock %}\n    &lt;input type=&quot;file&quot; id=&quot;upload-file&quot; name=&quot;upload_file&quot;  \/&gt;\n    &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;\n      upload                     \n    &lt;\/button&gt;\n &lt;\/form&gt;\n{% endblock %}<\/pre>\n\n\n\n<p>In the above code, <code>{{ path('frontend.test.upload') }}<\/code> is a route name of the function in the controller, it sends the request to that function, <code>data-form-csrf-handler=\"true\"<\/code>  is a handler of csrf token. If it set to true then it is able to handle the csrf token.<\/p>\n\n\n\n<p><code>{{ sw_csrf('frontend.test.upload') }}<\/code> is a csrf token function which generates a token for the form. Parameters of the csrf function should be the same as the route name of the controller<\/p>\n\n\n\n<p>Now, lets create the controller for uploading an image.<\/p>\n\n\n\n<p><strong>TestController.php<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php declare(strict_types=1);\n\nuse Shopware\\Storefront\\Controller\\StorefrontController;\nuse Shopware\\Core\\Framework\\Context;\nuse Shopware\\Core\\Framework\\Routing\\Annotation\\RouteScope;\nuse Shopware\\Core\\Framework\\Uuid\\Uuid;\nuse Shopware\\Core\\Content\\Media\\File\\FileSaver;\nuse Shopware\\Core\\Content\\Media\\File\\MediaFile;\nuse Shopware\\Core\\Content\\Media\\File\\FileNameProvider;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\nuse Shopware\\Core\\Framework\\Util\\Random;\n\n\/**\n * @RouteScope(scopes={&quot;storefront&quot;})\n *\/\nclass TestController extends StorefrontController \n{\n   private $mediaUpdater;\n   private $fileNameProvider;\n   private $systemConfigService;\n\n   public function __construct(\n       FileSaver $mediaUpdater,\n       FileNameProvider $fileNameProvider      \n    ) {\n       $this-&gt;mediaUpdater = $mediaUpdater;\n       $this-&gt;fileNameProvider = $fileNameProvider;     \n    }\n    \n     \/**\n     * @Route(&quot;\/upload\/image&quot;, name=&quot;frontend.test.upload&quot;, defaults={&quot;csrf_protected&quot;=false})\n     *\/\n    public function uploadMedia(Request $request)\n    {\n        $data = $request-&gt;files;\n        $testSupportedExtension = array(&#039;gif&#039;, &#039;png&#039;, &#039;jpg&#039;, &#039;jpeg&#039;, &#039;pdf&#039;);\n        \n        $context = Context::createDefaultContext();\n        $mediaRepository = $this-&gt;container-&gt;get(&#039;media.repository&#039;);\n        \n        foreach ($data as $file) {\n            $fileName = $file-&gt;getClientOriginalName();\n            $ext = pathinfo($fileName, PATHINFO_EXTENSION);\n            if (!in_array($ext,$testSupportedExtension) ) {\n                $error = true;\n                $message = &#039;Invalid Extension&#039;;\n            } else {\n                $fileName = $fileName . Random::getInteger(100, 1000);\n                \n                $mediaId = Uuid::randomHex();\n                $media = &#091;\n                    &#091;\n                        &#039;id&#039; =&gt; $mediaId,\n                        &#039;name&#039; =&gt; $fileName,\n                        &#039;fileName&#039; =&gt; $fileName,\n                        &#039;mimeType&#039; =&gt; $file-&gt;getClientMimeType(),\n                        &#039;fileExtension&#039; =&gt; $file-&gt;guessExtension(),\n                     ]\n                 ];\n                    \n                $mediaId = $mediaRepository-&gt;create($media, Context::createDefaultContext())- \n                &gt;getEvents()-&gt;getElements()&#091;1]-&gt;getIds()&#091;0];\n                if (is_array($mediaId)) {\n                    $mediaId = $mediaId&#091;&#039;mediaId&#039;];\n                }\n                try {\n                    $this-&gt;upload($file, $fileName, $mediaId, $context);                \n                } catch (\\Exception $exception) {\n                    $fileName = $fileName . Random::getInteger(100, 1000);\n                    $this-&gt;upload($file, $fileName, $mediaId, $context);\n                }\n            }\n        }\n    } \n\n    public function upload($file, $fileName, $mediaId, $context)\n    {   \n        return $this-&gt;mediaUpdater-&gt;persistFileToMedia(\n            new MediaFile(\n                $file-&gt;getRealPath(),\n                $file-&gt;getMimeType(),\n                $file-&gt;guessExtension(),\n                $file-&gt;getSize()\n            ),\n            $this-&gt;fileNameProvider-&gt;provide(\n                $fileName,\n                $file-&gt;getExtension(),\n                $mediaId,\n                $context\n            ),\n            $mediaId,\n            $context\n        );  \n    }\n}<\/pre>\n\n\n\n<p>To upload an image, you need to import some files are FileSaver, MediaFile, FileNameProvider which helps to upload an image in Shopware 6. These files are also included in the service file.<br>In the above code, you can add your own validation for the image. You have to use a media Repository for saving media data to the media table.<\/p>\n\n\n\n<p><code>Uuid::randomHex()<\/code> it generates a unique id for the media table. <code>id<\/code> , <code>fileName<\/code>,<code> name<\/code>, <code>mimeType<\/code>, <code>fileExtension<\/code> these are important fields for the media Repository. Now you have to save the mediaId. You can use this mediaId to get detail of an image, you also find the URL of an image.<\/p>\n\n\n\n<p>I hope it will help you. Thanks for reading. Happy Coding \ud83d\ude42<br>Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, you are going to learn \u201cHow to upload an image in Shopware 6 at the storefront.\u201dI hope you know the directory structure of Shopware 6 plugin, if you don&#8217;t know, see here- https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/internals\/directory-structure. Firstly, you have to create an form in html.twig file. In my case, file name is test.html.twig . test.html.twig <a href=\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":284,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-254808","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to upload an image at a storefront in Shopware 6 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to upload an image at a storefront in Shopware 6 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-16T04:21:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-16T04:21:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Diwakar Rana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Diwakar Rana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\"},\"author\":{\"name\":\"Diwakar Rana\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f\"},\"headline\":\"How to upload an image at a storefront in Shopware 6\",\"datePublished\":\"2020-06-16T04:21:25+00:00\",\"dateModified\":\"2020-06-16T04:21:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\"},\"wordCount\":270,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\",\"name\":\"How to upload an image at a storefront in Shopware 6 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2020-06-16T04:21:25+00:00\",\"dateModified\":\"2020-06-16T04:21:27+00:00\",\"description\":\"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to upload an image at a storefront in Shopware 6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f\",\"name\":\"Diwakar Rana\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Diwakar Rana\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/diwakar-rana829\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to upload an image at a storefront in Shopware 6 - Webkul Blog","description":"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/","og_locale":"en_US","og_type":"article","og_title":"How to upload an image at a storefront in Shopware 6 - Webkul Blog","og_description":"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.","og_url":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2020-06-16T04:21:25+00:00","article_modified_time":"2020-06-16T04:21:27+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Diwakar Rana","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Diwakar Rana","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/"},"author":{"name":"Diwakar Rana","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f"},"headline":"How to upload an image at a storefront in Shopware 6","datePublished":"2020-06-16T04:21:25+00:00","dateModified":"2020-06-16T04:21:27+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/"},"wordCount":270,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/","url":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/","name":"How to upload an image at a storefront in Shopware 6 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2020-06-16T04:21:25+00:00","dateModified":"2020-06-16T04:21:27+00:00","description":"Upload an image at a storefront in shopware 6 using the file saver, media file, file name provider. These files helps to upload an image.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-upload-an-image-at-a-storefront-in-shopware-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to upload an image at a storefront in Shopware 6"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f","name":"Diwakar Rana","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Diwakar Rana"},"url":"https:\/\/webkul.com\/blog\/author\/diwakar-rana829\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/254808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/284"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=254808"}],"version-history":[{"count":10,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/254808\/revisions"}],"predecessor-version":[{"id":254823,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/254808\/revisions\/254823"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=254808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=254808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=254808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}