Laravel Seeable - Keep track of the date and time a user was last seen.

Overview

Packagist Version Packagist Downloads

Laravel Seeable

This package makes it easy to keep track of the date and time a user was last seen.

Installation

  1. Install this package.
    composer require zepfietje/laravel-seeable
  2. Optionally publish the configuration file.
    php artisan vendor:publish --tag="seeable-config"
  3. Add a seen_at column to your users table.
    return new class extends Migration
    {
        public function up(): void
        {
            Schema::table('users', function (Blueprint $table) {
                $table->timestamp('seen_at')->nullable();
            });
        }
    
        // ...
    };
  4. Add the Seeable concern to your user model.
    namespace App\Models;
    
    // ...
    use ZepFietje\Seeable\Concerns\Seeable;
    
    class User extends Authenticatable
    {
        // ...
        use Seeable;
    }
  5. Register the SeeUser middleware in your app/Http/Kernel.php file.
    protected $middlewareGroups = [
        'web' => [
            // ...
            \ZepFietje\Seeable\Http\Middleware\SeeUser::class,
        ],
    ];

Usage

Query scopes

User::seenAfter('2022-06-30')->get();
$dailyActiveUsers = User::seenPastDay()->count();
$weeklyActiveUsers = User::seenPastWeek()->count();
$monthlyActiveUsers = User::seenPastMonth()->count();
You might also like...
Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.

Laravel Otpify 🔑 Introduction Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords. Install

Talk is a real-time users messaging and chatting system Laravel.
Talk is a real-time users messaging and chatting system Laravel.

Laravel-Talk Talk is a Laravel 5 based user conversation (inbox) system with realtime messaging. You can easily integrate this package with any Larave

A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache.

Laravel OTP Introduction A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache. The ca

Laravel Real-time chat app demo with React, Laravel Echo, Breeze, Socket.io, Redis, Inertia.js, TailwindCSS stack.

Laravel Real-time Chat App You can build yours from scratch with the following Medium article https://medium.com/@sinan.bekar/build-a-real-time-chat-a

Get estimated read time of an article. Similar to medium.com's "x min read". Multilingual including right-to-left written languages. Supports JSON, Array and String output.

Read Time Calculates the read time of an article. Output string e.g: x min read or 5 minutes read. Features Multilingual translations support. Static

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.
A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A simple Laravel package for generating download links with options such as expire time, IP restrictions, etc.

Generate download links in your Laravel applications This package allows you to generate download links for files. Once installed you can do stuff lik

Laravel real-time CRUD using Google Firebase.
Laravel real-time CRUD using Google Firebase.

Laravel real-time CRUD using Google Firebase.

Desafio prático para desenvolvedores fullstack que desejam entrar para nosso time.

Instruções para realizar os exercícios Essa avaliação é composta por três partes, que visam servir de base para análise das competências dos candidato

Comments
  • Gives  `TypeError` with Laravel-Nova-Excel export

    Gives `TypeError` with Laravel-Nova-Excel export

    Gives 500 status code and TypeError when exporting the data as excel.

    ZepFietje\Seeable\Http\Middleware\SeeUser::handle(): Return value must be of type Illuminate\Http\Response|Illuminate\Http\RedirectResponse|Illuminate\Http\JsonResponse, Symfony\Component\HttpFoundation\BinaryFileResponse returned

    laravel-seeable-01 laravel-seeable-02 laravel-seeable-03

    opened by itsdanielfelix 1
Releases(0.3.1)
A package to keep track of your pages & understand your audience

A clean way to track your pages & understand your user's behavior Installation You can install the package via composer: composer require coderflexx/l

Coderflex 178 Jan 4, 2023
Thunder is an advanced Laravel tool to track user consumption using Cashier's Metered Billing for Stripe. ⚡

⚡ Thunder Thunder is an advanced Laravel tool to track user consumption using Cashier's Metered Billing for Stripe. ⚡ ?? Supporting If you are using o

Renoki Co. 10 Nov 21, 2022
A Laravel package to help track user onboarding steps.

Onboard A Laravel package to help track user onboarding steps. Installation: Install the package via composer composer require calebporzio/onboard Reg

Caleb Porzio 440 Dec 17, 2022
A Laravel clone of the Javascript Flatpickr (Date picker) library

A Laravel clone of the Javascript Flatpickr (Date picker) library Using this package you can add a beautiful date or datetime picker into your project

Laratips 49 Dec 28, 2022
Ensure your Laravel applications keep a normal pulse

Ensure your Laravel applications keep a normal rhythm Laravel Defibrillator helps you ensure that aspects of your application that should be running a

Michael Dyrynda 148 Dec 20, 2022
Composer package which adds support for HTML5 elements using Laravels Form interface (e.g. Form::date())

Laravel HTML 5 Inputs Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date()) Adds support fo

Small Dog Studios 11 Oct 13, 2020
Laravel plugin to track your users logins and alert when a suspicious login occurs

Laravel Suspicious Logins Detect suspicious logins for standard Laravel authentication (base Laravel, Jetstream, etc) and notify a list of administrat

Advent Development 74 May 1, 2022
This package allows you to easily track your laravel jobs!

Trackable Jobs For Laravel This package allows you to track your laravel jobs! Using this package, you can easily persist the output and the status of

Mateus Junges 220 Dec 25, 2022
🕵🏻‍♂️  The easiest way to respect the "do not track" header in Laravel

trackable The easiest way to respect the "do not track" header in Laravel Installation composer require s360digital/trackable API Trackable will expos

s360 2 Oct 7, 2022
User authentication REST API with Laravel (Register, Email verification, Login, Logout, Logged user data, Change password, Reset password)

User Authentication API with Laravel This project is a user authentication REST API application that I developed by using Laravel and MySql. Setup Fir

Yusuf Ziya YILDIRIM 3 Aug 23, 2022