LaravelPackages.net
Acme Inc.
Toggle sidebar
ismailocal/sleep

Laravel - Sleep your users

2
2
About ismailocal/sleep

ismailocal/sleep is a Laravel package for laravel - sleep your users. It currently has 2 GitHub stars and 2 downloads on Packagist. Install it with composer require ismailocal/sleep. Discover more Laravel packages by ismailocal or browse all Laravel packages to compare alternatives.

Last updated

laravel-sleep

You can sleep users easily.

Installation

composer require ismailocal/sleep

Configuration

php artisan vendor:publish --provider="Ismailocal\Sleep\SleepServiceProvider"

then open "config/sleep.php" and replace "table" name with your sleepable table name.

Sleepable Trait

use Ismailocal\Sleep\Traits\Sleepable;

class User extends Authenticatable{

  use Sleepable;

Migration

php artisan migrate

Middleware

Route::middleware(['check.sleep'])->group(function () {

Throwing "UserSleepingException" when user sleeping!

Usage

$user->sleep(1, 'day');
or
$user->sleep(2, 'hours');

$user->save();

Check

$user->isSleeping(); // return boolean

Star History Chart