/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     table_media_manager::find($id)->delete();
     return redirect('admin/media-manager')->with('warning', 'Data successfully removed!');
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $currentfile = table_media_manager::find($id);
     $currentfile = $currentfile->media_manager_filename;
     if (file_exists('./UPLOADED/' . $currentfile)) {
         unlink('./UPLOADED/' . $currentfile);
     }
     table_media_manager::find($id)->delete();
     return redirect('admin/media-manager')->with('warning', 'Data have been removed!');
 }