Esempio n. 1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $item = Vacancy::findOrFail($id);
     $this->authorize('destroy', $item);
     $item->delete();
     $redis = LRedis::connection();
     //DEL key [key ...]
     $redis->del('vacancy_title::' . $item->id);
     // LREM key count value
     $redis->lrem('latest_vacancy_ids', $item->id, 0);
     return redirect('/vacancy/index');
 }