From 3c0e33fef78c5a0cd099e9c013d63b39a0292b05 Mon Sep 17 00:00:00 2001 From: Miguel N Date: Mon, 25 Oct 2021 02:08:32 +0100 Subject: [PATCH] Fix issue with account deletions Also, added the ignition file for customising the error page for devs --- app/Http/Controllers/UserController.php | 2 +- app/Observers/UserObserver.php | 1 + config/ignition.php | 126 ++++++++++++++++++++++++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 config/ignition.php diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 2f0d2f4..532819b 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -235,7 +235,7 @@ class UserController extends Controller $this->authorize('delete', $user); if ($request->confirmPrompt == 'DELETE ACCOUNT') { - $user->forceDelete(); + $user->delete(); $request->session()->flash('success', __('User deleted successfully.')); } else { $request->session()->flash('error', __('Wrong confirmation text! Try again.')); diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php index 4e62976..16d2cdb 100755 --- a/app/Observers/UserObserver.php +++ b/app/Observers/UserObserver.php @@ -63,6 +63,7 @@ class UserObserver public function deleting(User $user) { + Log::debug("Deleting observer running"); if ($user->isForceDeleting()) { $user->profile->delete(); Log::debug('Referential integrity cleanup: Deleted profile!'); diff --git a/config/ignition.php b/config/ignition.php new file mode 100644 index 0000000..b465423 --- /dev/null +++ b/config/ignition.php @@ -0,0 +1,126 @@ + env('IGNITION_EDITOR', 'phpstorm'), + + /* + |-------------------------------------------------------------------------- + | Theme + |-------------------------------------------------------------------------- + | + | Here you may specify which theme Ignition should use. + | + | Supported: "light", "dark", "auto" + | + */ + + 'theme' => env('IGNITION_THEME', 'dark'), + + /* + |-------------------------------------------------------------------------- + | Sharing + |-------------------------------------------------------------------------- + | + | You can share local errors with colleagues or others around the world. + | Sharing is completely free and doesn't require an account on Flare. + | + | If necessary, you can completely disable sharing below. + | + */ + + 'enable_share_button' => env('IGNITION_SHARING_ENABLED', true), + + /* + |-------------------------------------------------------------------------- + | Register Ignition commands + |-------------------------------------------------------------------------- + | + | Ignition comes with an additional make command that lets you create + | new solution classes more easily. To keep your default Laravel + | installation clean, this command is not registered by default. + | + | You can enable the command registration below. + | + */ + 'register_commands' => env('REGISTER_IGNITION_COMMANDS', false), + + /* + |-------------------------------------------------------------------------- + | Ignored Solution Providers + |-------------------------------------------------------------------------- + | + | You may specify a list of solution providers (as fully qualified class + | names) that shouldn't be loaded. Ignition will ignore these classes + | and possible solutions provided by them will never be displayed. + | + */ + + 'ignored_solution_providers' => [ + \Facade\Ignition\SolutionProviders\MissingPackageSolutionProvider::class, + ], + + /* + |-------------------------------------------------------------------------- + | Runnable Solutions + |-------------------------------------------------------------------------- + | + | Some solutions that Ignition displays are runnable and can perform + | various tasks. Runnable solutions are enabled when your app has + | debug mode enabled. You may also fully disable this feature. + | + */ + + 'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null), + + /* + |-------------------------------------------------------------------------- + | Remote Path Mapping + |-------------------------------------------------------------------------- + | + | If you are using a remote dev server, like Laravel Homestead, Docker, or + | even a remote VPS, it will be necessary to specify your path mapping. + | + | Leaving one, or both of these, empty or null will not trigger the remote + | URL changes and Ignition will treat your editor links as local files. + | + | "remote_sites_path" is an absolute base path for your sites or projects + | in Homestead, Vagrant, Docker, or another remote development server. + | + | Example value: "/home/vagrant/Code" + | + | "local_sites_path" is an absolute base path for your sites or projects + | on your local computer where your IDE or code editor is running on. + | + | Example values: "/Users//Code", "C:\Users\\Documents\Code" + | + */ + + 'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''), + 'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''), + + /* + |-------------------------------------------------------------------------- + | Housekeeping Endpoint Prefix + |-------------------------------------------------------------------------- + | + | Ignition registers a couple of routes when it is enabled. Below you may + | specify a route prefix that will be used to host all internal links. + | + */ + 'housekeeping_endpoint_prefix' => '_ignition', + +];