oguzcandemircan/laravel-guest

:description

Downloads

14

Stars

0

Version

v0.2.0

Laravel Guest

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

Resource Method Type
OguzcanDemircan\LaravelGuest\LaravelGuest isGuest Boolean
OguzcanDemircan\LaravelGuest\LaravelGuest isMember Boolean
OguzcanDemircan\LaravelGuest\Helpers\Functions.php is_guest() Boolean
OguzcanDemircan\LaravelGuest\Helpers\Functions.php is_member() Boolean
OguzcanDemircan\LaravelGuest\Helpers\Functions.php user_id() Integer

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.

oguzcandemircan

Author

oguzcandemircan