pxlrbt / filament-activity-log Goto Github PK
View Code? Open in Web Editor NEWSpatie activity log integration into Filament
License: MIT License
Spatie activity log integration into Filament
License: MIT License
Having an issue on fresh install.
Not sure if this is related to this statement, that I am unsure how to execute:
Make sure you use a custom theme and the vendor folder for this plugins is published, so that it includes the Tailwind CSS classes.
If I go into the cache file and remove @livewire('livewire-ui-spotlight')
it loads the page.
Any help would be greatly appreciated!
Hi
If my model has a property casted to array the view cannot print changes
htmlspecialchars(): Argument #1 ($string) must be of type string, array given
in
my property in activity_log is this
{
"attributes": {
"number": "23080827832",
"service": "multi",
"type": "s",
"date_issued": "2023-01-18",
"date_expiration": "2023-02-09",
"status": 4,
"status_updated_at": "2023-05-30T10:18:44.000000Z",
"supplier_sfid": "0011i00000KFLiiAAH",
"customer_sfid": "0016N00000cuRhOQAU",
"consumptions": {
"gn": 170,
"ee": 262
},
"amounts": {
"gn": 236.95,
"ee": 122.27
},
"fattura_sfid": {
"ee": "a036N00000ABhMAQA1",
"gn": "a036N00000ABhM6QAL"
},
"ranking": 30,
"home_sfid": null
},
"old": {
"number": "2308082783",
"service": "multi",
"type": "ds",
"date_issued": "2023-01-18",
"date_expiration": "2023-02-09",
"status": 4,
"status_updated_at": "2023-05-30T10:18:44.000000Z",
"supplier_sfid": "0011i00000KFLiiAAH",
"customer_sfid": "0016N00000cuRhOQAU",
"consumptions": {
"gn": 170,
"ee": 262
},
"amounts": {
"gn": 236.95,
"ee": 122.27
},
"fattura_sfid": {
"ee": "a036N00000ABhMAQA1",
"gn": "a036N00000ABhM6QAL"
},
"ranking": 0,
"home_sfid": "a116N000004LMnLQAW"
}
}
Hello Dennis,
I would like to use your filament package, but have some troubles to get it running.
I get always a illegal offset type from the table action and i tried so much different things. Maybe you can give me a hint.
I created a page inside my filament resource folder called "ListStopActivities.php"
<?php
namespace App\Filament\Resources\StopResource\Pages;
use App\Filament\Resources\StopResource;
use pxlrbt\FilamentActivityLog\Pages\ListActivities;
class ListStopActivities extends ListActivities
{
protected static string $resource = StopResource::class;
}
Afterwards i added the page to the getPages method:
public static function getPages(): array
{
return [
'index' => Pages\ListStops::route('/'),
'create' => Pages\CreateStop::route('/create'),
'edit' => Pages\EditStop::route('/{record}/edit'),
'activities' => Pages\ListStopActivities::route('/{record}/activities'),
];
}
And last i added the action to the table action array.
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
Tables\Actions\Action::make('activities')->url(fn ($record) => StopResource::getUrl('activities', [$record => $record])),
])
Maybe you have a hint?
Thanks, Armin
The authorization to restore an activity is hardcoded to the restore
policy method through static::getResource()::canRestore(...)
, which is meant for restoring soft-deleted models (https://filamentphp.com/docs/3.x/actions/prebuilt-actions/restore). Since this concerns a different type of restoring, I propose the authorization method to be overwritable.
Hi, thanks for the hardwork.
I am currently using this plugin on Filament V.3
I realized that the related model attributes is not showing on the view.
The setup from https://spatie.be/docs/laravel-activitylog/v4/advanced-usage/logging-model-events#content-logging-directly-related-model-attributes has been done correctly. Checked on database, it has a value below:
Is there any setup missing on my side?
There are no requests being made to the server, and so no reversion is actually done when clicking the button.
Have tested this numerous times across a bunch of resources.
Hi
is there any feature in this plugin to show all logs in a table?
Callback to map values formatState()
or similar for display.
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
I encountered the error "Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization"
while using Filament v3.0-stable and PHP 8.1.
Current contemplating in the future building a restore feature to the activities so a user can restore the old values back should they wish, limited to the properties column of course.
this is my Model what if I want all the logs at Once
`<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;
class MfmUser extends Model
{
use HasFactory, SoftDeletes, LogsActivity;
protected $fillable = [
'companyId',
'firstName',
'lastName',
'email',
'password',
'phone',
'type',
'role',
'locationIds',
'profilePhoto',
'mfm_userId',
];
public function permissions()
{
return $this->belongsTo(Permission::class, 'permissions_id');
}
public function contactTask()
{
return $this->hasOne(ContactTasks::class);
}
public function contactNote()
{
return $this->hasOne(ContactNote::class);
}
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logOnly([
'companyId', 'firstName', 'lastName', 'email', 'password','phone','type','role', 'locationIds','',
]) // Customize the fields to log
->logOnlyDirty()
->useLogName('mfm_user_log');
}
}
`
this is my custom page
<?php
namespace App\Filament\Resources\MfmUserResource\Pages;
use pxlrbt\FilamentActivityLog\Pages\ListActivities;
use App\Filament\Resources\MfmUserResource;
class ListMfmUsersActivities extends ListActivities
{
protected static string $resource = MfmUserResource::class;
}
After following the steps, seeing this error when listing users:
Missing required parameter for [Route: filament.admin.resources.users.activities] [URI: admin/users/{record}/activities] [Missing parameter: record].
I always get this error message. I have created the ListUserActivities under Filament\Resource\UserResource\Pages. In the UserResource I registered the page and added an action to the table. I see the Activities link next to each user but when I click on it, I always get the Call to undefined method App\Models\User::activities()
error.
HI, would be great if it can display custom events, the this in spatie/laravel-activitylog
doc
activity()
->performedOn($anEloquentModel)
->causedBy($user)
->withProperties(['customProperty' => 'customValue'])
->log('Look mum, I logged something');
๐ Heyo. Neat package!
I've followed the installation instructions and I've noticed there is no direct way to navigate to a given user/model's activities other than directly going to /{record}/activities
. Am I missing something, or would it be good to have actions to access activities from the List and View pages?
I can have a crack at it over the weekend, but wanted to highlight it for now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.