{"action":"closed","issue":{"url":"https://api.github.com/repos/Shopify/shopify_api/issues/451","repository_url":"https://api.github.com/repos/Shopify/shopify_api","labels_url":"https://api.github.com/repos/Shopify/shopify_api/issues/451/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/shopify_api/issues/451/comments","events_url":"https://api.github.com/repos/Shopify/shopify_api/issues/451/events","html_url":"https://github.com/Shopify/shopify_api/issues/451","id":336519605,"node_id":"MDU6SXNzdWUzMzY1MTk2MDU=","number":451,"title":"Laravel in api shopify","user":{"login":"Aram77778","id":40657390,"node_id":"MDQ6VXNlcjQwNjU3Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/40657390?v=4","gravatar_id":"","url":"https://api.github.com/users/Aram77778","html_url":"https://github.com/Aram77778","followers_url":"https://api.github.com/users/Aram77778/followers","following_url":"https://api.github.com/users/Aram77778/following{/other_user}","gists_url":"https://api.github.com/users/Aram77778/gists{/gist_id}","starred_url":"https://api.github.com/users/Aram77778/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aram77778/subscriptions","organizations_url":"https://api.github.com/users/Aram77778/orgs","repos_url":"https://api.github.com/users/Aram77778/repos","events_url":"https://api.github.com/users/Aram77778/events{/privacy}","received_events_url":"https://api.github.com/users/Aram77778/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T08:18:36Z","updated_at":"2018-06-28T17:48:43Z","closed_at":"2018-06-28T17:48:43Z","author_association":"NONE","body":"//Controller\r\npublic function addprod(Request $request)\r\n    {\r\n        $realname=$_POST['realname'];\r\n        $message=$_POST['message'];\r\n        $type=$_POST['type'];\r\n        $prod=$_POST['prod'];\r\n        $Money=$_POST['Money'];\r\n        $gram=$_POST['Gram'];\r\n        $path=$request->file('video')->store('uploads');\r\n        $name=explode(\"/\", $path);\r\n        $name=$name['1'];\r\n        $users = DB::table('product')->insert(\r\n            ['name' => $name,'realname'=>$realname,'message' => $message,'type'=>$type,'prod'=>$prod,'Money'=>$Money,'gram'=>$gram]\r\n        );\r\n        $products_array = array(\r\n            \"product\"=>array(\r\n                \"title\"=> $realname,\r\n                \"body_html\"=> \"<strong>$message</strong>\",\r\n                \"vendor\"=> $prod,\r\n                \"product_type\"=> $type,\r\n                \"images\"=>array(array(\r\n          \"src\" =>  \"/uploads/\".$name\r\n    )),\r\n                \"published\"=> true ,\r\n                \"variants\"=>array(\r\n                    array(\r\n                        \"sku\"=>\"t_009\",\r\n                        \"price\"=>$Money,\r\n                        \"grams\"=>$gram,\r\n                        \"taxable\"=>false,\r\n\r\n                    )\r\n                ),\r\n            ),\r\n        );\r\n//        echo json_encode($products_array);\r\n//        echo \"<br />\";\r\n             $url = \"https://{{apikey}}:{{password}}@{{shopname}}.myshopify.com/admin/products.json\";\r\n\r\n        $curl = curl_init();\r\n        curl_setopt($curl, CURLOPT_URL, $url);\r\n        curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\r\n        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n        curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n        curl_setopt($curl, CURLOPT_HEADER, 1);\r\n        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n        curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($products_array));\r\n        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n        $response = curl_exec ($curl);\r\n        curl_close ($curl);\r\n//        echo \"<pre>\";\r\n//        print_r($response);\r\n        echo '<p style=\"color:green;\">Спасибо Ваш Продукт Добавлена на Сайт</p>';\r\n        return view('shops');\r\n    }public function addprod(Request $request)\r\n    {\r\n        $realname=$_POST['realname'];\r\n        $message=$_POST['message'];\r\n        $type=$_POST['type'];\r\n        $prod=$_POST['prod'];\r\n        $Money=$_POST['Money'];\r\n        $gram=$_POST['Gram'];\r\n        $path=$request->file('video')->store('uploads');\r\n        $name=explode(\"/\", $path);\r\n        $name=$name['1'];\r\n        $users = DB::table('product')->insert(\r\n            ['name' => $name,'realname'=>$realname,'message' => $message,'type'=>$type,'prod'=>$prod,'Money'=>$Money,'gram'=>$gram]\r\n        );\r\n        $products_array = array(\r\n            \"product\"=>array(\r\n                \"title\"=> $realname,\r\n                \"body_html\"=> \"<strong>$message</strong>\",\r\n                \"vendor\"=> $prod,\r\n                \"product_type\"=> $type,\r\n                \"images\"=>array(array(\r\n          \"src\" =>  \"/uploads/\".$name\r\n    )),\r\n                \"published\"=> true ,\r\n                \"variants\"=>array(\r\n                    array(\r\n                        \"sku\"=>\"t_009\",\r\n                        \"price\"=>$Money,\r\n                        \"grams\"=>$gram,\r\n                        \"taxable\"=>false,\r\n\r\n                    )\r\n                ),\r\n            ),\r\n        );\r\n//        echo json_encode($products_array);\r\n//        echo \"<br />\";\r\n        $url = \"https://{{apikey}}:{{password}}@{{shopname}}.myshopify.com/admin/products.json\";\r\n        $curl = curl_init();\r\n        curl_setopt($curl, CURLOPT_URL, $url);\r\n        curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\r\n        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n        curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n        curl_setopt($curl, CURLOPT_HEADER, 1);\r\n        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n        curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($products_array));\r\n        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n        $response = curl_exec ($curl);\r\n        curl_close ($curl);\r\n//        echo \"<pre>\";\r\n//        print_r($response);\r\n        echo '<p style=\"color:green;\">Спасибо Ваш Продукт Добавлена на Сайт</p>';\r\n        return view('shops');\r\n    } \r\n//end controller\r\n\r\n//VIEW\r\n@extends('layouts.app')\r\n@section('content')\r\n    <form action=\"{{ URL::to('/addprod')}} \" enctype=\"multipart/form-data\" method=\"post\">\r\n        <input type=\"file\" name=\"video\" ><br><br>\r\n        Имя Товара <input type=\"text\" name=\"realname\" value=\"\"><br><br>\r\n        Тип Товара <input type=\"text\" name=\"type\" value=\"\"><br><br>\r\n        <textarea placeholder=\"Характиристика Данного Товара\" name=\"message\" rows=\"10\" cols=\"45\" required></textarea><br>\r\n        Продавец <input type=\"text\" name=\"prod\" value=\"\"><br><br>\r\n        Цена товара <input type=\"number\" name=\"Money\" value=\"\"> AMD<br><br>\r\n        Вес товара <input type=\"number\" name=\"Gram\" value=\"\"> GRAM<br><br>\r\n\r\n        <input type=\"hidden\" name=\"_token\" value=\" {{csrf_token()}} \"><br>\r\n        <button type=\"submit\" name=\"button\">Сохранить Товар</button>\r\n    </form><br>\r\n    <form action=\"/\">\r\n        <button type=\"submit\">Назад</button>\r\n    </form>\r\n@endsection \r\n//end view"}}
{"actor":{"display_login":"jamiemtdwyer"}}