spatie / activitylog

A very simple activity logger to monitor the users of your website or application
https://spatie.be/opensource/laravel
MIT License
582 stars 75 forks source link

Activity::cleanLog(); #28

Closed hugofabricio closed 8 years ago

hugofabricio commented 8 years ago

I use Activity::cleanLog(); to clean up the database table, return true but not delete the logs of table.

/**
 * [destroy description]
 * @return [type] [description]
 */
public function destroy()
{
    if (Activity::cleanLog()):
        flash()->success('Logs excluídos com sucesso.');
    else:
        // Exibe a mensagem de sucesso
        flash()->warning('Um erro ocorreu ao excluir os logs, tente novamente.');
    endif;
    // Redireciona para listagem de logs
    return redirect()->route('painel.logs.index');
}
hugofabricio commented 8 years ago

Sorry, I did not realize it deletes for the previous period to the period set.

Thank you, it's working perfectly.