/** * Remove the specified resource from storage. * * @param string $id * @return Response */ public function destroy($id) { try { Application::ownBy($this->user)->where('_id', $id)->delete(); Token::where('app_id', $id)->where('user_id', $this->user->id)->delete(); session()->flash('success', 'Application is successfully deleted.'); } catch (\Exception $e) { session()->flash('error', 'Error occured to delete application.'); } return back(); }