Closed mohammad6006 closed 9 years ago
If you want to import both the modal and the facade in one class you'll have to use and alias:
use Activity:
use Spatie\Activitylog\Models\Activity as ActivityModel;
in your code:
$latestActivities = ActivityModel::with('user')->latest()->limit(100)->get(); // this code works
Alternatively you could skip the import, but then you'll have to use the full class name:
$latestActivities = \Spatie\Activitylog\Models\Activity::with('user')->latest()->limit(100)->get();
thank you very much I solved that problem
but why ip address store ::1 in database (I test it in localhost)
I believe ::1
is the ipv6 representation of localhost
in controller
use Spatie\Activitylog\Models\Activity;
$latestActivities = Activity::with('user')->latest()->limit(100)->get(); // this code works
but i can not use this code : Activity::log("You have updated your basic user information");
error : Call to undefined method Illuminate\Database\Query\Builder::log()
when i use Activity; error is . class activity not found or is used i changed use Spatie\Activitylog\Models\Activity as activitymodel not solved my problem