Код: Выделить всё
{{
Form::model($books, array(
'route' => array('package.update', $books->id),
'method' => 'put',
'files'=>'true')
)
}}
Код: Выделить всё
$ch = curl_init();
$file = $data['file'];
$data['title'] = $data['course_name'];
if (isset($data['file']))
$data['file'] = new CURLFile($_FILES['file']['tmp_name'], 'application/pdf',$_FILES['file']['name']);
$data['resource_id'] = $book->urnid;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
print_r(curl_error($ch));
curl_close($ch);
Код: Выделить всё
{"detail":"Method 'PUT' not allowed."}
Подробнее здесь: https://stackoverflow.com/questions/311 ... ate-in-php