Make laravel/passport client cacheable.

Overview

Laravel Passport Cache Client

Make laravel/passport client cacheable.

Sponsor me

Installing

$ composer require overtrue/laravel-passport-cache-client -vvv

Usage

Thanks to Laravel's automatic package discovery mechanism, you don't need to do any additional operations.

Of course, you can also control the cache strategy freely, just need to configure the following in the configuration file:

config/passport.php

return [
    //...
    'cache' => [
        // Cache key prefix
        'prefix' => 'passport_',
        
        // The lifetime of passport cache(seconds).
        'expires_in' => 300,
        
        // Cache tags
        'tags' => [],
    ],
];

❤️ Sponsor me

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 ❤️

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

You might also like...
A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2).

MRZ (Machine Readable Zones) Parser for PHP A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2

HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast usage.

HttpRequestor from Patienceman HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast

 amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface
amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface

amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface This client library provides access to the Amadeus GDS SOAP Web Service i

The Salla OAuth Client library is designed to provide client applications with secure delegated access to Salla Merchant stores.
The Salla OAuth Client library is designed to provide client applications with secure delegated access to Salla Merchant stores.

Salla Provider for OAuth 2.0 Client This package provides Salla OAuth 2.0 support for the PHP League's OAuth 2.0 Client. To use this package, it will

Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

PHP Kafka client is used in PHP-FPM and Swoole. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.

longlang/phpkafka Introduction English | 简体中文 PHP Kafka client is used in PHP-FPM and Swoole. The communication protocol is based on the JSON file in

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Postgis extensions for laravel. Aims to make it easy to work with geometries from laravel models.

Laravel Wrapper for PostgreSQL's Geo-Extension Postgis Features Work with geometry classes instead of arrays. $model-myPoint = new Point(1,2); //lat

Laravel Craftsman CLI for easily crafting Laravel assets for any project (artisan make on steroids)
Laravel Craftsman CLI for easily crafting Laravel assets for any project (artisan make on steroids)

Laravel Craftsman Description Laravel Craftsman (written using the awesome Laravel-Zero CLI builder) provides a suite of crafting assets using a proje

Make Laravel Pivot Tables using the new Laravel 9 closure migration format

This will allow you to create pivot table migration files using the new Laravel 9 closure migration format by simply passing two models.

Make your Laravel app comply with the crazy EU cookie law
Make your Laravel app comply with the crazy EU cookie law

Make your Laravel app comply with the crazy EU cookie law All sites owned by EU citizens or targeted towards EU citizens must comply with a crazy EU l

A drop-in library for certain database functionality in Laravel, that allows for extra features that may never make it into the main project.

Eloquence Eloquence is a package to extend Laravel's base Eloquent models and functionality. It provides a number of utilities and classes to work wit

A minimal package to help you make your laravel application cleaner and faster.
A minimal package to help you make your laravel application cleaner and faster.

Laravel Widgetize 🎀 🎀 "cleaner code" ➕ "easy caching" 🎀 🎀 Built with ❤️ for every smart laravel developer 🔦 Introduction What is a widget object

A package to easily make use of Iconic icons in your Laravel Blade views.
A package to easily make use of Iconic icons in your Laravel Blade views.

Blade Iconic A package to easily make use of Iconic icons in your Laravel Blade views. For a full list of available icons see the SVG directory. Iconi

A package to easily make use of Simple Icons in your Laravel Blade views.
A package to easily make use of Simple Icons in your Laravel Blade views.

Blade Simple Icons A package to easily make use of Simple Icons in your Laravel Blade views. For a full list of available icons see the SVG directory.

Creates an 'artisan workflow:make' command to scaffold out a number of useful GitHub actions workflows for Laravel

Laravel workflow generator This creates a make:workflow artisan command to scaffold out a number of useful GitHub actions workflows for Laravel. Insta

Make your Laravel app comply with the refuse/accept cookie law

Make your Laravel app comply with the refuse/accept cookie law All sites owned by EU citizens or targeted towards EU citizens must comply with a crazy

Comments
  • CacheClientRepository 报错

    CacheClientRepository 报错

    我使用Laravel 6

    错误:

    {
        "message": "Cannot call constructor",
        "exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
        "file": "/var/www/demo/vendor/overtrue/laravel-passport-cache-client/src/CacheClientRepository.php",
    }
    

    番了一下CacheClientRepository

      /**
         * CacheClientRepository constructor.
         *
         * @param null        $personalAccessClientId
         * @param null        $personalAccessClientSecret
         * @param string|null $cacheKey
         * @param int|null    $expiresInSeconds
         * @param array       $tags
         * @param string|null $store
         */
        public function __construct(
            $personalAccessClientId = null,
            $personalAccessClientSecret = null,
            string $cacheKey = null,
            int $expiresInSeconds = null,
            array $tags = [],
            ?string $store = null
        ) {
            parent::__construct($personalAccessClientId, $personalAccessClientSecret);
            $this->cacheKeyPrefix = sprintf('%s_client_', $cacheKey ?? 'passport');
            $this->expiresInSeconds = $expiresInSeconds ?? 5 * 60;
            $this->cacheTags = \array_merge($tags, [$this->cacheTag]);
            $this->cacheStore = $store ?? \config('cache.default');
        }
    

    这里调用父类的构造函数,但是我点进去父类查看并没有覆写构造函数,而且父类并没有继承任何类 :joy:

    opened by JimChenWYU 8
Releases(2.1.1)
Owner
安正超
Keep calm and coding.
安正超
Query caching for Laravel

Query caching for Laravel

Dwight Watson 1k Dec 30, 2022
LaraCache is an ORM based package for Laravel to create, update and manage cache items based on model queries

LaraCache Using this package, you can cache your heavy and most used queries. All you have to do is to define the CacheEntity objects in the model and

Mostafa Zeinivand 202 Dec 19, 2022
Simple artisan command to debug your redis cache. Requires PHP 8.1 & Laravel 9

?? php artisan cache:debug Simple artisan command to debug your redis cache ?? Installation You can install the package via composer: composer require

Juan Pablo Barreto 19 Sep 18, 2022
The Missing check on Laravel Request Unicity.

Motivation This laravel package will allow you to execute a code once in the current request based on the key provided. Installation composer require

Inani El Houssain 8 Oct 27, 2022
Making Laravel Passport work with Lumen

lumen-passport Making Laravel Passport work with Lumen A simple service provider that makes Laravel Passport work with Lumen Dependencies PHP >= 5.6.3

Denis Mysenko 651 Dec 1, 2022
Laravel passport authentication API endpoints

Basic sample code for Laravel/Passport to authenticate users via API

Devdreamsolution 2 Oct 19, 2021
Laravel Custom Response Messages from Passport Oauth2 Server

This is a sample repository showing how to install Oauth2 server using Laravel's passport package and customize its responses.

M. Ismail 7 Nov 22, 2022
Laravel Passport Memoized

Laravel Passport comes with repositories for the underlying oauth2-server that result in multiple queries to retrieve the same exact object from the database in a single request. With a good database engine this will have a small impact in the range of milliseconds but this is still unacceptable and should be avoided if possible.

Alex Bouma 26 Aug 15, 2022
Laravel Passport is an OAuth2 server and API authentication package that is simple and enjoyable to use

Introduction Laravel Passport is an OAuth2 server and API authentication package that is simple and enjoyable to use. Official Documentation Documenta

The Laravel Framework 3.1k Dec 31, 2022
Joy VoyagerApi module adds REST Api end points to Voyager with Passport and Swagger support.

Joy VoyagerApi This Laravel/Voyager module adds REST Api with Passport and Swagger support to Voyager. By ?? Ramakant Gangwar. Prerequisites Composer

Ramakant Gangwar 14 Dec 12, 2022