markjtaps / login
A Laravel 11 package that displays a SweetAlert welcome message on user login.
dev-main
2025-11-10 08:52 UTC
Requires
- php: ^8.2
- illuminate/support: ^11.0|^12.0
This package is not auto-updated.
Last update: 2026-03-31 08:56:02 UTC
README
A simple Laravel 11 package that displays a SweetAlert welcome message whenever a user logs in.
Installation
Install the package via Composer (local development):
composer require markjtaps/login:@dev --prefer-source ## Setup Follow these steps to set up the package in your Laravel 11 application: 1. Register Middleware Add the middleware to your app/Http/Kernel.php file in the web group: ```bash protected $middlewareGroups = [ 'web' => [ // ... \Markjtaps\Login\Http\Middleware\LoginAlertMiddleware::class, ], ]; This middleware sets a session variable with the user’s name on login. ## 2. Include Blade Directive** Include the Blade directive in your main layout (e.g., resources/views/layouts/app.blade.php): ```bash @loginAlert This directive renders the SweetAlert script whenever a user logs in.