Create New Passport Client for a User in Laravel and Passport inside Controller

Is there a way to create passport client in Laravel. For example, to create a Token, we can do:

$user = $request->user();
$token = $user->createToken("myApp")->accessToken;

Do we something for Client too?

$user = $request->user();
$token = $user->createClient("myApp")->accessClient;

I checked the documentation and it is possible to create a client using an API, but the example is in Vue.JS

const data = {
name: 'Client Name',
redirect: 'http://example.com/callback'
};

axios.post('/oauth/clients', data)
.then(response => {
console.log(response.data);
})
.catch (response => {
// List errors on response...
});

But I am unable to run this example in POSTMAN... I am not sure which function or method is being triggered for above API Call. How can I make use of this POST method outside VueJS.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3eVfQYv
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time