- return redirect()->to($this->getRedirectUrl())
- ->withInput($request->input())
- ->withErrors($errors, $this->errorBag());
+ /**
+ * Show a warning notification to the user on next view load.
+ */
+ protected function showWarningNotification(string $message): void
+ {
+ session()->flash('warning', $message);
+ }
+
+ /**
+ * Show an error notification to the user on next view load.
+ */
+ protected function showErrorNotification(string $message): void
+ {
+ session()->flash('error', $message);
+ }
+
+ /**
+ * Log an activity in the system.
+ *
+ * @param string|Loggable $detail
+ */
+ protected function logActivity(string $type, $detail = ''): void
+ {
+ Activity::add($type, $detail);