PHPackages                             mark-villudo/login-activiy-logs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. mark-villudo/login-activiy-logs

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

mark-villudo/login-activiy-logs
===============================

Laravel package API for user login using sunctum

01PHP

Since Oct 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MarkVilludo/login-activity-logs)[ Packagist](https://packagist.org/packages/mark-villudo/login-activiy-logs)[ RSS](/packages/mark-villudo-login-activiy-logs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Login and Activity Logs in Laravel
==================================

[](#login-and-activity-logs-in-laravel)

Laravel package to log each user's activity in the system and include api token based login using sanctum

Installation
------------

[](#installation)

Require this package with composer.

```
composer require mark-villudo/login-activiy-logs
```

### Publish the Sanctum configuration and migration files using the vendor:publish Artisan command. The sanctum configuration file will be placed in your application's config directory:

[](#publish-the-sanctum-configuration-and-migration-files-using-the-vendorpublish-artisan-command-the-sanctum-configuration-file-will-be-placed-in-your-applications-config-directory)

```
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"

```

### Finally, you should run your database migrations. Sanctum will create one database table in which to store API tokens:

[](#finally-you-should-run-your-database-migrations-sanctum-will-create-one-database-table-in-which-to-store-api-tokens)

```
php artisan migrate

```

### To begin issuing tokens for users, your User model should use the Laravel\\Sanctum\\HasApiTokens trait:

[](#to-begin-issuing-tokens-for-users-your-user-model-should-use-the-laravelsanctumhasapitokens-trait)

```
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable;
}

```

Activity Logs
=============

[](#activity-logs)

Setup Migrations and Model
--------------------------

[](#setup-migrations-and-model)

Make model with migration file at the same time.
 Note: At the package the model used is under "App\\Models" then please do so.

```
php artisan make:model Models/ActivityLog -m

```

Activity Logs Table Structure

```
