/**
  * @param int $storeId
  * @param int $id
  * @return mixed
  */
 public function destroy($storeId, $id)
 {
     if (!($store = $this->storeRepository->getItem($storeId))) {
         return $this->respondNotFound();
     }
     $this->hookRepository->delete($store, $id);
     return Redirect::route('stores.hooks.index', [$storeId]);
 }
 /**
  * @param $id
  * @return mixed
  */
 public function setStoreToken($id)
 {
     $store = $this->repository->getItem($id);
     $provider = App::make('shopify', $store);
     if ($code = Input::get('code')) {
         $store->token = serialize($provider->getAccessToken('authorization_code', compact('code')));
         $store->save();
         return Redirect::route('stores.index');
     }
     return Redirect::to($provider->getAuthorizationUrl());
 }