DEV Community

Diadal Nig Ltd
Diadal Nig Ltd

Posted on • Updated on • Originally published at

Convert client_id to Uuid in Laravel Passport

Convert client_id to Uuid in Laravel Passport

Build Status Total Downloads License


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


composer require diadal/passport

Laravel 5.5 hight auto discover package you may need to register in your config app.php under providers


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

public function register()


php artisan config:clear

To publish Cilent Uuid migration use this

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

if no file published try

php artisan config:clear

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

Note you can use this both

Migrate your Database

php artisan migrate

Next In AuthServiceProvider @ app/Providers/AuthServiceProvider.php add use Diadal\Passport\Passport;


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()


            'all' => 'All Function',
            'create-invoice' => 'Create Invoice',



Next, you should run the passport:install command

php artisan passport:install
php artisan config:clear

All default Laravel Passport remain the same

Official Documentation

Documentation for Passport can be found on the Laravel website.

Any issue check here

if you find this helpful you can buy me a coffee @ Patreon

Top comments (0)