Skip to content

Make a request to one endpoint from another controller  #634

Open
@hymenoby

Description

@hymenoby

Hello,
How do i make a request to one resource endpoint without using an http client?
Here is my problem I have create a controller to update the current user informations. I have a users ressource configured. When i try to create a request like this and pass it to the app()->handle() functions the request fails with a 500 error :

$request = Request::create(
'/api/v1/users/1',
'POST',
$data,
);
$response = app()->handle($request);

is there a way to call a ressource controller action without using an $httpClient?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions