public function getTrash()
 {
     $records = Work::where('status', 'trash')->get();
     $recordsCount = count($records);
     return view(vw('theme.work.trash'), compact('records', 'recordsCount'))->with(array('title' => 'Silinmiş İşler'));
 }
 public function getDelete($id, $recovery = '')
 {
     $record = Customer::find($id);
     if (count($record) <= 0) {
         return redirect(clink('customer'));
     }
     if ($recovery == 'recovery') {
         $record->status = 'publish';
     } else {
         Work::where('customer_id', $record->id)->update(['status' => 'trash']);
         $record->status = 'trash';
     }
     $record->save();
     if ($record->save()) {
         if ($recovery == 'recovery') {
             Session::flash('message', ['title' => 'Tebrikler!', 'text' => 'Müşteri başarıyla geri yüklenmiştir.', 'type' => 'success']);
         } else {
             Session::flash('message', ['title' => 'Tebrikler!', 'text' => 'Müşteri başarıyla silinmiştir.', 'type' => 'success']);
         }
         return redirect()->back()->withInput();
     } else {
         Session::flash('message', ['title' => 'Hata!', 'text' => 'Müşteri silinemedi! Lütfen tekrar deneyiniz', 'type' => 'error']);
         return redirect()->back()->withInput();
     }
 }