laravel-mongodb
laravel-mongodb copied to clipboard
Does laravel-mongodb has passport support ?
I have been trying work with passport and mongodb. Do this package has passport support ? If not is any other solutions make it work with passport ?
Currently when I am running
php artisan passport:install
I am getting the following error
Encryption keys generated successfully.
In Connection.php line 451:
Call to a member function prepare() on null
Hey @majuansari. Please see the implementation in this pull request https://github.com/jenssegers/laravel-mongodb/pull/1333
@DMNSteve Thank you. Seems like this has not been merged to the repo. Is there anyway I could use this or fix issue without editing the passport codebase ?
You could use the fork at https://github.com/DMNSteve/laravel-mongodb.
Or you could fork the repository yourself and patch that pull request. :)
@DMNSteve Im using your provider + classes adapted to extend MongoDB eloquent model, from your PR but when I use the password credential type the tokens user_id is always the first use on my DB, no matter wich credentials I use on the Auth process.
public function createNewApiToken($name , $client_id , $scopes = [])
{
$token = $this->createToken($name, $scopes);
$token_model = Token::find($token->token->id);
$token_model->client_id = $client_id;
$token_model->save();
$token->token = $token_model;
return $token;
}
Currently added that method and accesing it to auth, as a dirty fix ¿did you have any Issue with password grant auth type ?
I didn't have any issues myself. What version of Passport are you using? I'd like to investigate a little further.
@DMNSteve if anything I can help let me know
"jenssegers/mongodb": "3.3.1",
"laravel/framework": "5.5.*",
"laravel/passport": "^4.0",
Any particular reason why your pull request is not merged ?
Just waiting for it to be reviewed by one of the maintainers. Hopefully, it should be merged soon.
@LeonAlvarez, sorry for the delay. Hope you had a Merry Christmas and Happy new year!
I just had a go at this from a fresh Laravel installation and I wasn't able to reproduce the issue https://github.com/DMNSteve/1390
The only difference is that I'm using my fork at version 3.3.3 https://github.com/DMNSteve/1390/blob/master/composer.json
Might be worth having comparing some of your files with this fresh installation to see if there is anything glaringly obvious.
The user class might be a file of interest https://github.com/DMNSteve/1390/blob/master/app/User.php.
Let me know if you come across anything or would like me to have another go at reproducing
Happy new year! @DMNSteve I fixed it not sure where was the issue I removed depencies isntaled again and added your files and its working fine now.
@majuansari I've closed the initial pull request and moved it to its own package available here https://github.com/StevePorter92/laravel-mongodb-passport
@majuansari @jenssegers A PR, with slightly different approach is added: https://github.com/jenssegers/laravel-mongodb/pull/1451
jenssegers/laravel-mongodb
not supported mongodb connection
to use passport in laravel with mongodb , you install this package :
https://github.com/designmynight/laravel-mongodb-passport
Hi, is there any update in this issue? It will be implemented in any near future?
@esron, You can override main models inherited from laravel database eloquent models on jenssegers models in service provider and use them for work with passport
I think if you want this feature in laravel mongodb, you can link to slack community and ask maintainer or community. Link here
@Smolevich thank you for your insight. I'll try that.
@esron did you find any solution for this?
@inquisitive-stha for now I'm using https://github.com/designmynight/laravel-mongodb-passport.
I didn't have the time to test the models customization .