/**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     //This id is passed by the controller that calls the request class
     $wishlist = WishList::find($this->id);
     switch ($this->method()) {
         case 'GET':
         case 'DELETE':
             return [];
         case 'POST':
             return ['item' => 'required|unique:wishlist,item', 'link' => 'required'];
         case 'PUT':
         case 'PATCH':
             return ['item' => 'required||unique:wishlist,item,' . $wishlist->id, 'link' => 'required'];
         default:
             break;
     }
 }
 public function changeStatus($id)
 {
     $item = WishList::find($id);
     //Change the status
     if ($item->active == true) {
         $item->active = false;
     } else {
         $item->active = true;
     }
     //Save the change
     $item->save();
     //Sending the user to the accounts page
     return redirect()->route('wishlist/index');
 }