I have several apps that interact with APIs which don't have their own SDK, so I wrote a package to make it super simple to work with them, and flexible enough for any API.
I hope is useful for someone.
Trucker is a PHP package for mapping remote API resources (usually RESTful) as models in an ActiveResource style. The benefit is easier use of remote APIs in a fast and clean programming interface.
<?php
class Product extends Trucker\Resource\Model {} //create a class to use
$p = new Product(['name' => 'My Test Product']);
$success = $p->save(); //create a new entity
$found = Product::find(1); //find an existing entity
$found->name = 'New Product Name';
$success = $found->save(); //update an entity
$success = $found->destroy(); //destroy an entity
$results = Product::all(); //find a collection
Links
I'm seeing this error Any ideas why?
ReflectionException Class trucker.config-manager does not exist
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community