laravel-mongodb icon indicating copy to clipboard operation
laravel-mongodb copied to clipboard

How I use laravel passport with this mongodb package ? As I creating Apis for my project so I require passport package.

Open boss554 opened this issue 9 months ago • 1 comments

Is your feature request related to a problem?

A clear and concise description of what the problem is.

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

boss554 avatar May 03 '24 06:05 boss554

We tentatively plan to work on Passport support in the second half of this year. Please follow PHPORM-178 for updates.

bisht2050 avatar May 03 '24 08:05 bisht2050

Is your feature request related to a problem?

A clear and concise description of what the problem is.

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

https://laravel.com/docs/11.x/passport#overriding-default-models

and use the DocumentModel trait

use Laravel\Passport\Client as PassportClient;
 use MongoDB\Laravel\Eloquent\DocumentModel;

class Client extends PassportClient
{
   use DocumentModel;
}

I havent tested it with passport but most of third party packages I use, all of it work using the DocumentModel trait for Custom Model that has an extends Class already

masterbater avatar Aug 21 '24 11:08 masterbater

Thank you @masterbater, that's exactly why we created the DocumentModel trait.

GromNaN avatar Aug 21 '24 12:08 GromNaN