public function deleteForm($form_id) { StoreFeedbackForms::destroy($form_id); return redirect()->action('SuperAdminController@getAllStores'); }
public function deleteForm($form_id) { $form['form'] = StoreFeedbackForms::where('id', $form_id)->get(); $id = Auth::id(); $store = UserStore::where('id', $form['form'][0]['store_id'])->get(); if ($id == $store[0]['user_id']) { StoreFeedbackForms::destroy($form_id); return redirect()->action('StoreAdminController@getAllStores'); } else { return 'ERROR Not Accessible'; } }