spatie / laravel-activitylog

Log activity inside your Laravel app
https://docs.spatie.be/laravel-activitylog
MIT License
5.38k stars 717 forks source link

after install the package, unable to use the feature at volt component #1303

Closed alexteh closed 2 months ago

alexteh commented 6 months ago

Describe the bug after install the package, unable to use the feature at volt component use Spatie\Activitylog\Models\Activity;

{{ activity()->log('Look mum, I logged something'); }}

To Reproduce after install the package, use the feature at volt component use Spatie\Activitylog\Models\Activity;

{{ activity()->log('Look mum, I logged something'); }}

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information)

Exception insert into activity_log (log_name, properties, causer_id, causer_type, batch_uuid, description, updated_at, created_at) values (default, [], 9c102677-c810-4d0f-a09c-5dd3ea428ac8, App\Models\User, ?, Look mum, I logged something, 2024-05-17 07:51:55, 2024-05-17 07:51:55)

Stack Trace insert into activity_log (log_name, properties, causer_id, causer_type, batch_uuid, description, updated_at, created_at) values (default, [], 9c102677-c810-4d0f-a09c-5dd3ea428ac8, App\Models\User, ?, Look mum, I logged something, 2024-05-17 07:51:55, 2024-05-17 07:51:55)

image image

alexteh commented 6 months ago

found the root cause, the initial setup with the migration file given, causer_id is using unsigned bigint instead of UUID, where as the the User id currently im using is uuid. any solution to patch this for UUID's implementation?

alexteh commented 6 months ago

Not sure if this is the correct way, but the only thing i could think of is as soon as I require and publish the package, straightaway change this:

// from this: $table->nullableMorphs('subject', 'subject'); $table->nullableMorphs('causer', 'causer');

// to this: $table->nullableUuidMorphs('subject', 'subject'); $table->nullableUuidMorphs('causer', 'causer');

image

spatie-bot commented 2 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.