Support the ongoing development of Laravel.io →
posted 11 years ago
Packages

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

Last updated 3 years ago.
0

I'm seeing this error Any ideas why?

ReflectionException Class trucker.config-manager does not exist

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.