# PHP/Laravel Management API Instance (Access Token)

**URL:** <https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790>\
**Category:** Get Help\
**Tags:** actions-management-api, management-api\
**Created:** [April 15, 2023, 11:53am UTC](https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790 "2023-04-15T11:53:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LozziStyle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lozzistyle/32/45871_2.png) [@LozziStyle](https://community.auth0.com/u/LozziStyle)\
**Post date:** [April 15, 2023, 11:53am UTC](https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790/1 "2023-04-15T11:53:18Z")

</div>

Hello everyone.

I am using Auth0 in my laravel project. Meaning that I’m using the **Auth0-Laravel SDK** from [here](https://auth0.com/docs/quickstart/webapp/laravel/01-login).

On my **multipage** Website, I want to give the user the ability to _create, edit, show_ and _delete_ users from auth0. After some research, I’ve found out, that this is possible by using the **Manager Endpoint** , which is a connection to the Management API, which has all the functions I need.

Heres the problem: I havent found out how to use a manager instance in laravel. The only thing I found online is with **cURL** , but inside of the Auth0 SDK there seems to be a `ManagerEndpoint` class and an `Action` class, which both have `getAll()` methods and stuff that I want to use.

**So is there any easier way to do that?** Or do I have to go with cURL? And If I have to do it with cURL, how do I get the Access Token for my API? Thats something I couldn’t figure out as well.  
Doing `Auth::getSession()` and printing it, I see that there is a auth0 session token, but I cant save it into a variable and I’m not even sure if that would be the best approach.

THX!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 20, 2023, 1:04pm UTC](https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790/3 "2023-04-20T13:04:18Z")

</div>

Hi @LozziStyle,

I’m going to reach out to our team on this and I’ll get back to you. Thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 21, 2023, 7:28pm UTC](https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790/5 "2023-04-21T19:28:24Z")

</div>

Here’s is what the maintainer said:

> Since the Laravel SDK is built on top of the PHP SDK, it inherits all that good stuff from in there. Here’s how you can access the Management API through the Laravel SDK:
> 
> ```auto
> app('auth0')->getSdk()->management();
> 
> ```
> 
> So, for example, to update a user:
> 
> ```auto
> app('auth0') // Gets the Laravel SDK
> ->getSdk() // Gets the underlying PHP SDK
> ->management() // Gets the Management API from the PHP SDK
> ->users() // Gets the Users endpoint from the Management API
> ->update( // PATCH /api/v2/users/{id}, see: https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
> id: 'auth0|8675309',
> body: ['user_metadata' => ['favorite_color' => 'blue']]
> );
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 16, 2023, 1:20pm UTC](https://community.auth0.com/t/php-laravel-management-api-instance-access-token/104790/6 "2023-06-16T13:20:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
