PHPackages                             datakrama/lapiuth - 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. datakrama/lapiuth

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

datakrama/lapiuth
=================

Laravel API Auth, change the default authentication to API-friendly

v2.1.0(5y ago)018MITPHP

Since Jun 12Pushed 5y agoCompare

[ Source](https://github.com/datakrama/lapiuth)[ Packagist](https://packagist.org/packages/datakrama/lapiuth)[ RSS](/packages/datakrama-lapiuth/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

\[Abandoned\] Lapiuth - Laravel API Auth
========================================

[](#abandoned-lapiuth---laravel-api-auth)

[![Run Tests](https://github.com/datakrama/lapiuth/workflows/Run%20Tests/badge.svg)](https://github.com/datakrama/lapiuth/workflows/Run%20Tests/badge.svg)

As we all know, Laravel provides built-in features for authentication. But, that's only for the web, not the API. Because of this, Lapiuth was made.

Lapiuth is ready-to-use authentication library for Laravel based API server. This library is simple. But, it can still help our work. We hope so for you.

Requirements
------------

[](#requirements)

- [Laravel 7.x](https://github.com/laravel/laravel)
- [Passport 8.x](https://github.com/laravel/passport)
- [Personal Access Tokens with Passport](https://laravel.com/docs/6.x/passport#personal-access-tokens)
- [Lapires 2.x](https://github.com/datakrama/lapires)

Laravel Compatibility
---------------------

[](#laravel-compatibility)

LaravelPackage[6.x](https://laravel.com/docs/6.x)[1.x](https://github.com/datakrama/lapiuth/tree/v1)[7.x](https://laravel.com/docs/7.x)[2.x](https://github.com/datakrama/lapiuth/tree/v2)Installation
------------

[](#installation)

> Before using this package, make sure you have set your Passport Personal Access Token. You can see the documentation at

$ `composer require datakrama/lapiuth:"~2.0"`

Usages
------

[](#usages)

### Publish

[](#publish)

To publish config, all you need is run this command:

$ `php artisan vendor:publish --provider="Datakrama\Lapiuth\ServiceProvider"`

In this config, you can change client's url, password url, and email verify url.

### Auth's model trait

[](#auths-model-trait)

Because this package uses the default auth, you can use traits in your auth model, the same as Laravel do. There are two traits you can use, `Datakrama\Lapiuth\Traits\CanResetPassword` and `Datakrama\Lapiuth\Traits\MustVerifyEmail`. Each trait is to reset the password and email verification.

#### Example:

[](#example)

```
