PHPackages                             salmanzafar/laravel-jwt-auto-installer - 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. salmanzafar/laravel-jwt-auto-installer

AbandonedLibrary

salmanzafar/laravel-jwt-auto-installer
======================================

A Laravel Library that let's you add tymon jwt auth library and all it's features with single command

v1.0.1(6y ago)19562MITPHPPHP &gt;=7.0.0

Since Jan 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/salmanzafar949/laravel-jwt-auto-installer)[ Packagist](https://packagist.org/packages/salmanzafar/laravel-jwt-auto-installer)[ RSS](/packages/salmanzafar-laravel-jwt-auto-installer/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (4)Used By (0)

laravel-jwt-auto-installer
==========================

[](#laravel-jwt-auto-installer)

[![Latest Version](https://camo.githubusercontent.com/16ad82da0db5acb9ae38d3d8bc9e6be376f24ad3051cc7f0da0cc4318aace2be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)](https://github.com/salmanzafar949/laravel-jwt-auto-installer/releases)[![forks](https://camo.githubusercontent.com/2e6e60a716d86c42a1610c20628c1aa2881a8d9d4e509fac761c1dc8d74f53dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)](https://camo.githubusercontent.com/2e6e60a716d86c42a1610c20628c1aa2881a8d9d4e509fac761c1dc8d74f53dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)[![stars](https://camo.githubusercontent.com/092404078358546c164d693f88075bfd266da7c2d8cf302103dec265b83564cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)](https://camo.githubusercontent.com/092404078358546c164d693f88075bfd266da7c2d8cf302103dec265b83564cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)[![license](https://camo.githubusercontent.com/246aec40ea08d283b51e7f4f7315a060b054b36ce374e9f7b21ae6ed72f80ab9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)](https://camo.githubusercontent.com/246aec40ea08d283b51e7f4f7315a060b054b36ce374e9f7b21ae6ed72f80ab9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616c6d616e7a616661723934392f6c61726176656c2d6a77742d6175746f2d696e7374616c6c6572)[![Total Downloads](https://camo.githubusercontent.com/45d13371a16fcc990d00b6494ad21b36b6e6a0485404990846195bfd6a82928c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616c6d616e7a616661722f6c61726176656c2d6a77742d6175746f2d696e7374616c6c65723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salmanzafar/laravel-jwt-auto-installer)

A Laravel Library that let's you add tymon jwt auth library and all it's features with single command

Why this was required?
----------------------

[](#why-this-was-required)

The people who uses `tymon/jwt-auth` knows that every time they installs package they need to manually create AuthController and then copy and paste the entire code their and same things for Model and Routes. So every time when you have to do this it takes some time and being a developer we want more easy and simple way of doing thing. so the i came up with this idea of creating this and hopefully it will help you and will make your work easy.

### what this package will do?

[](#what-this-package-will-do)

The package will create the following things for you

- installs `tymon/jwt-auth` for you
- Will publish `AuthController (with code)` inside `App\Http\Controllers`
- `User.php` (Model with all code including jwt functions)
- Will publish Routes (will create all the routes for auth e.g`(login, register, authenticated user detail, refresh token, logout)` in `api.php`)
- Will also publish the `JWT_SECRET` in your .env

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

[](#installation)

Use the package manager [composer](https://packagist.org/packages/salmanzafar/laravel-jwt-auto-installer) to install laravel-jwt-auto-installer.

```
composer require salmanzafar/laravel-jwt-auto-installer
```

Enable the package (Optional)
-----------------------------

[](#enable-the-package-optional)

This package implements Laravel auto-discovery feature. After you install it the package provider and facade are added automatically for laravel &gt;= 5.5.

Configuration
-------------

[](#configuration)

Publish the service provider file

This step is required

```
php artisan vendor:publish --provider="Salman\AutoJWT\AutoJWTServiceProvider"
```

Usage
-----

[](#usage)

```
php artisan jwt:init

Controller Model and Routes and Jwt Secret published.Thanks
```

### That's it now it'll publish every thing you want e.g Controller Model(with functions jwt) and api routes for JWT

[](#thats-it-now-itll-publish-every-thing-you-want-eg-controller-modelwith-functions-jwt-and-api-routes-for-jwt)

### AuthController.php:

[](#authcontrollerphp)

```
