Пример #1
0
 /**
  * Map the video to a new layout
  *
  * @param $id
  * @return array
  * @throws VideoNotFoundException
  */
 public function mapVideo($id)
 {
     $video = Vimeo::request('/videos/' . $id, null, 'GET');
     if ($video['status'] == 200) {
         return ['status' => 200, 'name' => $video['body']['name'], 'description' => $video['body']['description'], 'link' => $video['body']['link']];
     } else {
         throw new VideoNotFoundException('The video could not be found.');
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $request = Vimeo::request('/videos/' . $this->video->getVimeoId(), [], 'DELETE');
     if ($request['status'] != 204) {
         \Log::info('Verificar DELETE video ' . $this->video->getVimeoId() . 'en vimeo');
     }
     try {
         $this->video->delete();
         \Flash::info('Video eliminado correctamente');
     } catch (QueryException $e) {
         \Flash::danger('El video no se pudo eliminar');
     }
     return redirect()->route('protocols.show', $this->protocol);
 }