Show the cleared activity log - softdeleted records.

@return \Illuminate\Http\Response
775624
public function showClearedActivityLog()
    {
        if (config('LaravelLogger.loggerPaginationEnabled')) {
            $activities = Activity::onlyTrashed()
                ->orderBy('created_at', 'desc')
                ->paginate(config('LaravelLogger.loggerPaginationPerPage'));
            $totalActivities = $activities->total();
        } else {
            $activities = Activity::onlyTrashed()
                ->orderBy('created_at', 'desc')
                ->get();
            $totalActivities = $activities->count();
        }

        self::mapAdditionalDetails($activities);

        $data = [
            'activities'        => $activities,
            'totalActivities'   => $totalActivities,
        ];

        return View('LaravelLogger::logger.activity-log-cleared', $data);
    }
263079
public function delete()
    {
        $this->triggerEvent('onBeforeDelete');

        $this->getFlexDirectory()->getStorage()->deleteRows([$this->getStorageKey() => $this->prepareStorage()]);

        try {
            $this->getFlexDirectory()->clearCache();
            if (method_exists($this, 'clearMediaCache')) {
                $this->clearMediaCache();
            }
        } catch (InvalidArgumentException $e) {
            /** @var Debugger $debugger */
            $debugger = Grav::instance()['debugger'];
            $debugger->addException($e);

            // Caching failed, but we can ignore that for now.
        }

        $this->triggerEvent('onAfterDelete');

        return $this;
    }
726139
public function actionRestore()
    {
        $post = Yii::$app->request->post();
        $query = new Query;
        $audit = $query
            ->from("audits.{$post['table']}")
            ->where('audit_id = :audit_id', ['audit_id' => $post['audit_id']])
            ->one();
        $this->setCurrentModel($post['table']);
        $criteria = [];
        /** @var \yii\db\ActiveRecord $model */
        $model = $this->_currentModel;
        foreach ($model->primaryKey() as $primaryKey) {
            $criteria[$primaryKey] = $audit[$primaryKey];
        }
        foreach ($this->module->tables[$post['table']]['updateSkip'] as $column) {
            if (isset($audit[$column])) {
                unset($audit[$column]);
            }
        }
        /** @var \yii\db\ActiveRecord $record */
        $record = $model->findOne($criteria);
        $record->setAttributes($audit, false);
        if ($record->save()) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'Record has been restored.'));
        } else {
            Yii::$app->session->setFlash('danger', Yii::t('app', 'Failed to restore record.'));
        }
        return $this->redirect(Yii::$app->request->referrer);
    }
484754
public static function soft_delete_properties()
	{
		$class = get_called_class();

		// If already determined
		if (array_key_exists($class, static::$_soft_delete_cached))
		{
			return static::$_soft_delete_cached[$class];
		}

		$properties = array();

		// Try to grab the properties from the class...
		if (property_exists($class, '_soft_delete'))
		{
			//Load up the info
			$properties = static::$_soft_delete;
		}

		// cache the properties for next usage
		static::$_soft_delete_cached[$class] = $properties;

		return static::$_soft_delete_cached[$class];
	}
480106
public static function onlyTrashed()
    {
        $instance = new static;

        $column = $instance->getQualifiedDeletedAtColumn();

        return $instance->newQueryWithoutScope(new SoftDeletingScope)->whereNotNull($column);
    }
1051140
public function clearAction()
    {

        /*
         * to do: check if logged in user is sysadmin
         * */
        if ($this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
            /** @var \Networking\InitCmsBundle\Lib\PhpCacheInterface $phpCache */
            $phpCache = $this->get('networking_init_cms.lib.php_cache');
            $phpCache->clean();

            /*clean function does not return status, therefore set success to true */
            $success = true;
            $response = ['success' => $success];

            return new Response(json_encode($response));
        } else {
            /*wrong autorisation */
            $success = false;
            $response = ['success' => $success];

            return new Response(json_encode($response));
        }
    }
1084227
public function withTrashed()
	{
		$column = $this->model->getQualifiedDeletedAtColumn();

		foreach ((array) $this->query->wheres as $key => $where)
		{
			// If the where clause is a soft delete date constraint, we will remove it from
			// the query and reset the keys on the wheres. This allows this developer to
			// include deleted model in a relationship result set that is lazy loaded.
			if ($this->isSoftDeleteConstraint($where, $column))
			{
				unset($this->query->wheres[$key]);

				$this->query->wheres = array_values($this->query->wheres);
			}
		}

		return $this;
	}
342143
public function index()
    {
        $deletedUsers = $this->repository
            ->query()
            ->withTrashed()
            ->whereStatus('DELETE_IN_PROGRESS');
        
        $dataGrid = new UserDeleteRequestDataGrid($deletedUsers);

        return view('avored-framework::user.user-delete-request.index')
            ->withDataGrid($dataGrid->dataGrid);
    }
657688
public function hasSoftDeleting()
    {
        if (!$this->hasDeleting()) {
            return false;
        }

        $managedModelClass = $this->getManagedModel();

        return in_array(
            SoftDeletes::class, class_uses_recursive(get_class(new $managedModelClass()))
        ) && $this->hasDeleting();
    }
972336
public function clear()
    {
        $this->status = 200;
        $this->reasonPhrase = '';
        $this->headers = [];
        $this->ucHeaders = [];
        $this->cookies = [];
        $this->body = null;
        $this->asgiMap = [];

        return $this;
    }
849993
public function getLastIndexingReport()
    {
        $queryBuilder = Db::getQueryBuilder('sys_log');
        $logResults = $queryBuilder
            ->select('*')
            ->from('sys_log')
            ->where(
                $queryBuilder->expr()->like(
                    'details',
                    $queryBuilder->quote('[ke_search]%', \PDO::PARAM_STR)
                )
            )
            ->orderBy('tstamp', 'DESC')
            ->setMaxResults(1)
            ->execute()
            ->fetchAll();

        return $logResults;
    }
265750
public function delete(): bool
    {
        $isSoftDeleted = array_key_exists('Illuminate\Database\Eloquent\SoftDeletes', class_uses($this));
        if ($this->exists && ! $isSoftDeleted) {
            $this->roles()->detach();
        }

        return parent::delete();
    }
1257940
public function getTrashed()
    {
        if (!$this->modelAdmin->hasSoftDeleting()) {
            return $this->missingMethod();
        }

        return view('flare::admin.modeladmin.trashed', [
                                                        'modelItems' => $this->modelAdmin->onlyTrashedItems(),
                                                        'totals' => $this->modelAdmin->totals(),
                                                    ]
                                                );
    }
197922
public function view()
    {
        $sys_msg = Session::get('sys_msg');
        $msg = (isset($sys_msg['msg'])) ? $sys_msg['msg'] : null;
        $type = (isset($sys_msg['type'])) ? $sys_msg['type'] : null;
        if (isset($msg) && isset($type)) {
            $msg = "<div class='alert alert-".$type."'>".'<a href="#" class="close" data-dismiss="alert">&times;</a>'.$msg.'</div>';
            $msg_data[] = $msg;
        }
        if (isset($msg_data)) {
            $data = implode('', $msg_data);
            Session::delete('sys_msg');
            //unset($_SESSION['sys_msg']);

            return $data;
        }
    }
645338
public function viewCleanup()
    {
        $path = sprintf('/%s/_view_cleanup', $this->databaseName);
        $response = $this->httpClient->request('POST', $path);
        if ($response->status >= 400) {
            throw HTTPException::fromResponse($path, $response);
        }

        return $response->body;
    }
729091
public function getLastModified()
	{
		if ($this->lastModified == null) {
			$this->requestHead();
		}
		return $this->lastModified == null ? new \DateTime() : $this->lastModified;
	}
979192
public function isLogged()
    {
        if (is_null($this->logged)) {
            $this->logged = (bool)is_user_logged_in();
        }

        return $this->logged;
    }