ismailocal/sleep

Laravel - Sleep your users

Downloads

2

Stars

2

Version

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
ismailocal

Author

ismailocal