Giter Site home page Giter Site logo

haruncpi / laravel-user-activity Goto Github PK

View Code? Open in Web Editor NEW
418.0 7.0 53.0 160 KB

Monitor user activity easily!

Home Page: https://laravelarticle.com/laravel-user-activity

laravel user-activity user-activity-monitoring laravel-package laravel-framework open-source

laravel-user-activity's Introduction

Laravel User Activity

Easily monitor your user activity with beautiful responsive & easy user-interface!

Image description

Documentation

Checkout features & full documentation of Laravel User Activity

Other Packages

Change Log

v1.0.6

  • Default user model App\Models\User to support laravel >=8
  • Carbon date parse instead of $dates cast.

v1.0.4

  • Completely enable or disable logging by activated config value
  • Added Base model logging compatibility

v1.0.3

  • Minor improvements

v1.0.2

  • Create log type added
  • User model configuration
  • UI ajax loading indicator

laravel-user-activity's People

Contributors

affektde avatar bjorkgard avatar fbsoares avatar haruncpi avatar mouadziani avatar ryusuke005 avatar samuelhgf avatar upi20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-user-activity's Issues

Validation Error In Laravel 11

Call to undefined method Haruncpi\LaravelUserActivity\Controllers\ActivityController::validate().
I checked and reliazed the problem is coming from the handleData method of the ActivityController in your code.

$this->validate($request, [
            'action'    => 'required|string',
            'user_id'   => 'sometimes|numeric',
            'log_type'  => 'sometimes|string',
            'table'     => 'sometimes|string',
            'from_date' => 'sometimes|date_format:Y-m-d',
            'to_date'   => 'sometimes|date_format:Y-m-d'
        ]);

When I changed it to:

$request->validate([
            'action'    => 'required|string',
            'user_id'   => 'sometimes|numeric',
            'log_type'  => 'sometimes|string',
            'table'     => 'sometimes|string',
            'from_date' => 'sometimes|date_format:Y-m-d',
            'to_date'   => 'sometimes|date_format:Y-m-d'
        ]);

The problem was resolved. But for some other reason, I am not getting any log data in the UI.

php artisan user-activity:install runs all migration files?

One thing I do not understand is why anyone would ever want to delete all of their data when installing a new package? It seems like this install command tried to run all of my migration files which if I did that live would delete all of the data in my database. Why does Laravel have this as the default for getting new migrations up? Makes no sense to me. I know I can run each migration by itself which I am going to have to edit the install command for this package so I can push it live or just do each step manually myself. I have 2 separate websites and databases for my project so even if I whipe my dev server data it will not be the end of the world. I initially wanted to just use svn to push new packages to my live site but that did not work because of some of the autoload files and things for composer and laravel so now I just push new models, livewire components etc pretty much everything but packages live through SVN but I run these package commands on my live site to get new packages up.

I guess the best solution for all of this on my end is to figure out how to get these autoload files to work well live and dev so I can install and test dev then push from dev to live via svn.

App\User not found

Hello,

I'm getting this error.

Class "App\User" not found {"userId":1,"exception":"[object] (Error(code: 0): Class "App\User" not found at C:\xampp\htdocs\pherp\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasRelationships.php:755)

I have checked the config\auth.php and it is correct.

'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ],

Larvel 8 Issue with Installing haruncpi/laravel-user-activity package

I am using Laravel 8 and Php 8.0. my os is Ubunto 20.04 I am trying to Install the User logs activity package.

showing this error

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires phpoffice/phpspreadsheet dev-NumberFormatMask-Helpers, found phpoffice/phpspreadsheet[dev-NumberFormatMask-Helpers] but the package is fixed to 1.20.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades, and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

What is the solution for this in Laravel 8.

create type missing ?

hello,
Thanks for this awesome package.
I think the create type is also important, how can I add it ?

Conflict with logs table

I already have a logs table in my application and the default install fails because of this conflict.

I changed the migration from logs to user_activity_logs and modified the code in ./src/Models

  • public $table = 'user_activity_logs';

and ./src/Traits to use the modified tables

  • static protected $logTable = 'user_activity_logs';
  • static protected $logTable = 'logs';

This works OK but it will probably break on any update that is made to the package.
Would it be possible to include a parameter in the install or config that allows for modifications to the default 'logs' table that is used.

Pagination not working

i used this but pagination not showing. how can i show pagination button or customize view for adding pagination?

Laravel Backpack conflict 404 error

Salam, When usin Laravel Backpack(Laravel admin panel i guess you know it) it ends with a conflict eithet admin/user-activity or admin/dashboard (a route of backpack) both they give 404 erro

to confirm that i installled Backopack demo (https://github.com/laravel-backpack/demo) app then i added user-activity package then i get the same erro
waiting for any solution bro.

haruncpi -user activity

user activity not showing edit,delete user activities and not insert that details into lgs table

admin/dashboard not working

Hello,
I installed the plugin following his instructions, but when I go to launch in the browse:
http: // localhost / admin / dashboard

shows a page with 404 error.

any help?

ps: i use Oracle

br
Max

Get error when installing

I get an error
In PackageManifest.php line 131:

Undefined index: name

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

On Create not logged

Hello,
I've changed the user-activity.php file for on_create to true but in log list all the data created it's not logged.

 'log_events' => [
        'on_create'     => true,
        'on_edit'       => true,
        'on_delete'     => true,
        'on_login'      => true,
        'on_lockout'    => true
    ]

image

Only log-in or edit are logged.
What can I do to log what is created?
Thank you

Display user-activity

When I try to display admin/user-activity it redirect me to /admin
Note that I edit middleware to 'auth:admin' in config file
Is there any solution ?!

Doesn't work with SQLite

I setup this package with SQLite database but it fails with:

SQLSTATE[HY000]: General error: 1 near "SHOW": syntax error (SQL: SHOW TABLES)

Only showing loading screen.

Right now I am using it only for user login and logout activity. I have configured User model as per documentation. Logs are getting stored in logs table (with table_name column empty) in database. But not getting loaded in admin/user-activity side. It only shows loading screen here. Am I missing anything ?
User.php

<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
use Haruncpi\LaravelUserActivity\Traits\Loggable;

class User extends Authenticatable
{
    use HasFactory, Notifiable, HasRoles, Loggable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

logs

No logs except login, password change and logout

Hello,
Thank you for your package. I have placed the trait Loggable in two models as requested, but nothing is shown in the log when I create entries for those models.

I am using this in the context of Livewire, but I'm sure this is not a problem since the creation of entries utilizes the model::create function.

Is there something I am missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.