GithubHelp home page GithubHelp logo

laravel-api-consumer's Introduction

Laravel Internal API Consumption

Build Status Coverage Status

Installation

composer require optimus/api-consumer 0.2.*

laravel-api-consumer's People

Contributors

esbenp avatar etorofiev avatar ognicki avatar pablo-bossi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-api-consumer's Issues

content has protect access in http-foundation/Request

In the function below
`public function singleRequest($method, $uri, array $data = [], array $headers = [], $content = null)
{
// Save the current request so we can reset the router back to it
// after we've completed our internal request.
$currentRequest = $this->request->instance()->duplicate();

    dd($currentRequest->content, $currentRequest->getContent());

    $headers = $this->overrideHeaders($currentRequest->server->getHeaders(), $headers);

    if ($this->disableMiddleware) {
        $this->app->instance('middleware.disable', true);
    }

    $response = $this->request($method, $uri, $data, $headers, $content);

    if ($this->disableMiddleware) {
        $this->app->instance('middleware.disable', false);
    }

    // Once the request has completed we reset the currentRequest of the router
    // to match the original request.
    $this->request->instance()->initialize(
        $currentRequest->query->all(),
        $currentRequest->request->all(),
        $currentRequest->attributes->all(),
        $currentRequest->cookies->all(),
        $currentRequest->files->all(),
        $currentRequest->server->all(),
        $currentRequest->content
    );

    return $response;
}`

We may need to change

$currentRequest->content
to
$currentRequest->getContent()

What does this package do?

I've inherited a project that uses this package. However, I can't find any documentation anywhere of what this package does.

Class apiconsumer does not exist

Do I need to do something extra as to create a service provider for this class ?

added under config.app.php 'providers' => [... Optimus\ApiConsumer\Provider\LaravelServiceProvider::class,

but I get Class apiconsumer does not exist

"Class Infrastructure\Auth\LoginProxy does not exist"

I am using Laravel 5.8
After

  1. composer require optimus/api-consumer 0.2.*
  2. In config/app.php added in providers array Optimus\ApiConsumer\Provider\LaravelServiceProvider::class,
  3. use Infrastructure\Auth\LoginProxy; in my Controller
  4. $response = $this->apiConsumer->post('/oauth/token', $data); in function

giving error "Class Infrastructure\Auth\LoginProxy does not exist"
Please help me.

Screenshot from 2020-01-17 16-19-57

Bug: Original request does not get restored correctly

Original request does not get restored correctly when using this package.

public function postCreate(NewsStoreRequest $request)
{
    $this->getInternalRouter()->post('/api/v1/news', $request->all(), $this->getInternalCallHeaders());
    
    return redirect()->route('news::index');
}

later - if I ask for the current request i will get the api request and not the post request.

// get the request url
dd(request()->fullUrl()); //outputs: /api/v1/news

But I was expecting it to output the original request url which is /news

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.