You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 1, 2019. It is now read-only.
Thank you for such a nice module. It works great. Its simple and working.
I just need to know why Activity::cleanLog(); is not working? Its showing this error
BadMethodCallException in Builder.php line 2161:
Call to undefined method Illuminate\Database\Query\Builder::cleanLog()
I am just using it normally, like below i have a controller with name LogsController and i have used use Spatie\Activitylog\Models\Activity; in which i have just 2 functions as below:
public function index()
{
$latestActivities = Activity::with('user')->latest()->get();
return view('logs.logs')->with('logs', $latestActivities);
}
public function clearlog(){
Activity::cleanLog();
Activity::log('Logs cleared By : '.Auth::user()->name);
\Session::flash('success', 'Logs deleted successfully');
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Spatie\Activitylog\Models\Activity;
//use Activity;
class LogsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$latestActivities = Activity::with('user')->latest()->get();
return view('logs.logs')->with('logs', $latestActivities);
}
public function headerLogs()
{
$latestActivities = Activity::with('user')->latest()->limit(10)->get();
return view('layouts.header')->with('logs', $latestActivities);
}
public function clearlog(){
Activity::cleanLog();
Activity::log('Logs cleared By : '.Auth::user()->name);
\Session::flash('success', 'Logs deleted successfully');
return redirect('logs');
}
}
Thank you for such a nice module. It works great. Its simple and working.
I just need to know why Activity::cleanLog(); is not working? Its showing this error
I am just using it normally, like below i have a controller with name LogsController and i have used
use Spatie\Activitylog\Models\Activity;
in which i have just 2 functions as below:I have defined a route for this:
I dont know where i am making mistake. Please help me get this thing straight. I am new to laravel.
Thank you!
The text was updated successfully, but these errors were encountered: