2017 © Pedro Peláez
 

library passport

Convert client_id to Uuid in Laravel Passport

image

diadal/passport

Convert client_id to Uuid in Laravel Passport

  • Saturday, July 28, 2018
  • by diadal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Convert client_id to Uuid in Laravel Passport, (*1)

Build Status Total Downloads License , (*2)

Introduction

Laravel Passport is an OAuth2 server and API authentication package that is simple and enjoyable to use. This Package will enable you you convert client id and client_id to Uuid which is more secure and safe for production, (*3)

Installation

composer require diadal/passport

Laravel 5.5 hight auto discover package you may need to register in your config app.php under providers, (*4)

Diadal\Passport\PassportServiceProvider::class,

Next in app/Providers/AppServiceProvider.php add \Laravel\Passport\Passport::ignoreMigrations(); to register, (*5)

public function register()
    {
        //....
        \Laravel\Passport\Passport::ignoreMigrations();
    }

Next, (*6)

php artisan config:clear

To publish Cilent Uuid migration use this, (*7)

php artisan vendor:publish --tag=passport-cilent-migrations

if no file published try, (*8)

php artisan config:clear

and retry php artisan vendor:publish --tag=passport-cilent-migrations, (*9)

Note you can use this both

Migrate your Database

php artisan migrate

Next In AuthServiceProvider @ app/Providers/AuthServiceProvider.php add use Diadal\Passport\Passport;, (*10)

<?php

namespace App\Providers;

use Diadal\Passport\Passport;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The policy mappings for the application.
     *
     * @var array
     */
    protected $policies = [
        'App\Model' => 'App\Policies\ModelPolicy',
    ];

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();

        Passport::routes();
        \Laravel\Passport\Passport::useClientModel(\Diadal\Passport\Client::class);
        \Laravel\Passport\Passport::usePersonalAccessClientModel(\Diadal\Passport\PersonalAccessClient::class);

        Passport::tokensCan([
            'all' => 'All Function',
            'create-invoice' => 'Create Invoice',
        ]);

        Passport::tokensExpireIn(now()->addDays(15));

        Passport::refreshTokensExpireIn(now()->addDays(30));
    }
}

Next, you should run the passport:install command, (*11)

php artisan passport:install
php artisan config:clear

All default Laravel Passport remain the same, (*12)

Official Documentation

Documentation for Passport can be found on the Laravel website., (*13)

Any issue check here, (*14)

also you can buy me a coffee @ Patreon, (*15)

The Versions

28/07 2018

dev-master

9999999-dev

Convert client_id to Uuid in Laravel Passport

  Sources   Download

MIT

The Requires

 

by Avatar diadal

laravel framework uuid laravel passport client uuid

28/07 2018

1.0.1.x-dev

1.0.1.9999999-dev

Convert client_id to Uuid in Laravel Passport

  Sources   Download

MIT

The Requires

 

by Avatar diadal

laravel framework uuid laravel passport client uuid