New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

repat/laravel-database-session-model

Eloquent Model for the sessions table as created by artisan session:table
11,541 1
Install
composer require repat/laravel-database-session-model
Latest Version:0.5
PHP:>=7.4
Laravel:7 – 11
License:MIT
Last Updated:Apr 2, 2024
Links: GitHub  ·  Packagist
Maintainer: repat

laravel-database-session-model

Latest Version on Packagist Total Downloads

laravel-database-session-model contains an Eloquent model for the sesssions (or config('sessions.table')) as created by the artisan commands sessions:table

Installation

$ composer require repat/laravel-database-session-model

Documentation

Relationship / Attributes

The attribute unserialized_payload returns the payload array, unserialized and base64 decoded. For more information, see the Laravel Documentation on Eloquent Mutators.

The attribute last_activity_at parses the last_activity as a UNIX timestamp.

If you've kept the standard FQCN for Laravels User Model (\App\Model\User::class) you can use the ->user relationship or extend this model and override the user() method.

$session = \Repat\LaravelSessions\Session::first();

// UUID
$session->id; // string

// User
$session->user_id;
$session->user; // App\Models\User, extend the relationship if you have a different FQCN

$session->ip_address; // string
$session->user_agent; // string

// Attributes
$session->unserialized_payload; // array
$session->last_activity_at; // \Carbon\Carbon

License

Version

  • Version 0.5

Contact

repat

Flattr this git repo

Related Packages

laravellegends/interactive-model

This library is helpful to record data in the Eloquent models interactively via...

8,521 1
repat/laravel-password-reset-model

Eloquent Model for the password_resets table

9,260 1
repat/laravel-migration-model

Eloquent Model for the migrations table

4,091 1
jenssegers/model

An Laravel eloquent-like model class, for Laravel and other frameworks

4,742,551 395
czim/laravel-nestedupdater

Eloquent model updater for nested relations data for Laravel.

54,158 19

Version History

Version Released PHP Laravel License
0.5 >=7.4 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT
0.4 >=7.4 ^7.0|^8.0|^9.0|^10.0 MIT
0.3 >=7.4 ^7.0|^8.0|^9.0 MIT
0.2 >=7.4 ^7.0|^8.0 MIT
0.1.1 >=7.4 ^7.0|^8.0 MIT