Coder Social home page Coder Social logo

Another call and it breaks about active HOT 3 CLOSED

letrunghieu avatar letrunghieu commented on August 20, 2024
Another call and it breaks

from active.

Comments (3)

letrunghieu avatar letrunghieu commented on August 20, 2024

Can you explain more about going to / and calling api/vi/posts. I have not imagine the situation yet.

from active.

dragonfire1119 avatar dragonfire1119 commented on August 20, 2024
Route::get('/', function() {
$api = json_decode(json_encode(HMVC::get('api/v1/post')));

$posts = $api->data;

return View:make('home', compact('posts'));
});

Instead of laravel seeing the uri as / it now sees it as api/v1/posts.

Hope this explains it better I'm using guzzle & hmvc. @letrunghieu

from active.

letrunghieu avatar letrunghieu commented on August 20, 2024

Hi dragonfire,

I guest that you are using the teepluss/hmvc package and I have read it package source. I found that when make a call by using this package, the request object of the application is kept but the current route is changed and does not restored.

However, the Active package is using the current route object instead of the request object to make decisions for the performance purpose. If I switch to using the request object to keep the compatibility with the HMVC package, I have to create the route each time a method called and I cannot use the existed route object of the Laravel application (you can read one of my article for further infomation)

from active.

Related Issues (20)

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.