PHPackages                             lukapeharda/cookie-guard - 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. lukapeharda/cookie-guard

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

lukapeharda/cookie-guard
========================

Provides authorization from cookie token.

v1.4.0(5y ago)52.2kMITPHPPHP &gt;=7.2CI failing

Since Sep 18Pushed 5y ago2 watchersCompare

[ Source](https://github.com/lukapeharda/cookie-guard)[ Packagist](https://packagist.org/packages/lukapeharda/cookie-guard)[ RSS](/packages/lukapeharda-cookie-guard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (8)Used By (0)

Cookie Guard
============

[](#cookie-guard)

Introduction
------------

[](#introduction)

Cookie Guard is a Laravel API authentication package using cookie tokens. Most of its inner workings are taken from Laravel Passport package. It is meant to be used to consume your own API with JavaScript.

Installation
------------

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
$ composer require lukapeharda/cookie-guard
```

Add the service provider to `config/app.php` in the `providers` array.

```
LukaPeharda\CookieGuard\CookieGuardServiceProvider::class,
```

Add the `LukaPeharda\CookieGuard\HasApiTokens` trait to your `App\User` model. This trait will provide a few helper methods to your model which allow you to inspect the authenticated user's token and scopes:

```
