oguzcandemircan/laravel-guest

v0.2.0 2019-05-13 08:07 UTC

This package is not auto-updated.

Last update: 2024-11-08 14:49:53 UTC


README

Latest Version on Packagist Total Downloads

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require oguzcandemircan/laravel-guest

Usage

Your models should use the LaravelGuestTrait trait.

use OguzcanDemircan\LaravelGuest\LaravelGuestTrait;

class User extends Authenticatable
{
  use LaravelGuestTrait
}

Via helper functions

user()->isGuest();

Via facades

$user = LaravelGuest::make();
$user->isGuest();

Via Laravel resolve helper function

$user = resolve('laravelguest')->make();
$user->isMember();   

Service Container

$user = $this->app->resolving('laravelguest')->make();
$user->name;

Helper Functions

if(is_member()) {
 #...
}
if(is_guest()) { 
#...
}

user_id()
#..

Available Methods

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ vendor/bin/phpunit test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.