PHPackages                             spiderwebtr/isauth - 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. spiderwebtr/isauth

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

spiderwebtr/isauth
==================

1.2.1(5y ago)13410.9k↓32.6%18[2 issues](https://github.com/spiderwebtr/isAuth/issues)MITJavaScript

Since Nov 17Pushed 5y ago8 watchersCompare

[ Source](https://github.com/spiderwebtr/isAuth)[ Packagist](https://packagist.org/packages/spiderwebtr/isauth)[ RSS](/packages/spiderwebtr-isauth/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (4)Used By (0)

isAuth
======

[](#isauth)

[![alt text](https://camo.githubusercontent.com/595696f52a119506c84aa9d9812bf41b81f9da4c532172e3dfabf90ead1084a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73706964657277656274722f697361757468 "Stable")](https://camo.githubusercontent.com/595696f52a119506c84aa9d9812bf41b81f9da4c532172e3dfabf90ead1084a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73706964657277656274722f697361757468)[![alt text](https://camo.githubusercontent.com/049e46f4cdb499e12361e28dc0879b3a4301f2003627422a1d99b6b7f8d39df2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73706964657277656274722f697361757468 "Downloads of this month")](https://camo.githubusercontent.com/049e46f4cdb499e12361e28dc0879b3a4301f2003627422a1d99b6b7f8d39df2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73706964657277656274722f697361757468)[![alt text](https://camo.githubusercontent.com/af495b42b94522aa2fb9fc9f7d7f5b5efcb63d2c9ad8999406d0d050fa0f02e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706964657277656274722f697361757468 "Total Downloads")](https://camo.githubusercontent.com/af495b42b94522aa2fb9fc9f7d7f5b5efcb63d2c9ad8999406d0d050fa0f02e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706964657277656274722f697361757468)[![alt text](https://camo.githubusercontent.com/d05b2f152b923730e584d2f0facd35ad20739975c65b252c5c4c90fd3dda1b59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73706964657277656274722f697361757468 "License")](https://camo.githubusercontent.com/d05b2f152b923730e584d2f0facd35ad20739975c65b252c5c4c90fd3dda1b59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73706964657277656274722f697361757468)[![alt text](https://camo.githubusercontent.com/923209e50e1d9bcc9ff4b469eb057f4e9fcbccdef9f547daa30ef969eda822ab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f656d7265646970693f7374796c653d736f6369616c "Github")](https://camo.githubusercontent.com/923209e50e1d9bcc9ff4b469eb057f4e9fcbccdef9f547daa30ef969eda822ab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f656d7265646970693f7374796c653d736f6369616c)

This package provides control to check if user session dead before submit forms. If the session is dead, a modal will reveal and ask password to re-login.

[![](image.jpg)](image.jpg)

### [Demo](http://isauth.herokuapp.com/)

[](#demo)

### [Demo Source](https://github.com/spiderwebtr/isAuthDemo)

[](#demo-source)

1- Installation
---------------

[](#1--installation)

Require this package with composer.

```
composer require spiderwebtr/isauth
```

### 1.2- Laravel &lt; 5.5

[](#12--laravel--55)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
spiderwebtr\isauth\isAuthServiceProvider::class,
```

### 2- Create assets and config file

[](#2--create-assets-and-config-file)

Run the command to create the js and config files.

```
php artisan vendor:publish --provider="spiderwebtr\isauth\isAuthServiceProvider" --force --tag="public" --tag="config"
```

### 3- Edit config/isAuth.php

[](#3--edit-configisauthphp)

Under config folder, you'll see [`isAuth`](src/config/isAuth.php) config file. Edit the fields for customizations.

```
return [
    "middleware"=>['web'], //for laravel routes (web,api...)
    "options"=>[
        "loginField"=>"email", //If your project uses username to login, change it with "username".
        "texts"=>[ //translate
            "placeholder"=>"Type Your Password",
            "wrong"=>"Wrong Password",
            "error"=>"Error",
            "button"=>"Login"
        ]
    ],
];
```

### 4- Include JQuery,Sweet Alert and @isAuthAssets in your footer

[](#4--include-jquerysweet-alert-and-isauthassets-in-your-footer)

You can download the js files or just use cdn. `@isAuthAssets` will call isAuth.js and define auth object with your config.

```

@isAuthAssets([
    "user"=>auth()->user(),
    "photo"=>$user->avatar //(not required) if you use avatar in your user system, pass the url of your user's avatar to "photo" key, if you don't use avatar, you can remove the key in array
])
```

Extras
------

[](#extras)

### 🔥 isAuth function

[](#fire-isauth-function)

`isAuth` function takes a callback parameter so in your code you can call `isAuth` to check the session before doing your js stuff.

```
auth.isAuth(function(){
    //do something
});
```

Login modal will reveal if the session is dead. When you re-login, your code will work with callback.

### Contributors

[](#contributors)

- [@emredipi](https://github.com/emredipi)
- [@jasonhoule](https://github.com/jasonhoule)
- You can be here :)

### Feedback

[](#feedback)

If you give me some feedback I will be happy. You can show your satisfaction with star. ⭐

### Update Guide

[](#update-guide)

- **v1.1** - If you downloaded the package in development version (dev-master), please remove it apply Installation Guide from this readme file (require,Create assets,Last Step).
- **v1.2** - Delete the js codes in footer, then start from step 2

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~185 days

Total

3

Last Release

2049d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ca07bf9edf82ddb8655ee95df134e9c8c5580aab99bdd15bff1d8fda759fa66?d=identicon)[emredipi](/maintainers/emredipi)

---

Top Contributors

[![emredipi](https://avatars.githubusercontent.com/u/23154364?v=4)](https://github.com/emredipi "emredipi (16 commits)")

---

Tags

isauthlogin-modal

### Embed Badge

![Health badge](/badges/spiderwebtr-isauth/health.svg)

```
[![Health](https://phpackages.com/badges/spiderwebtr-isauth/health.svg)](https://phpackages.com/packages/spiderwebtr-isauth)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
