aleahy / laravel-saasu-connect
Laravel wrapper for SaasuConnect
Requires
- php: ^8.2
- aleahy/saasu-connect: 0.1
- illuminate/database: ^10.0|11.0
- illuminate/support: ^10.0|11.0
- phpunit/phpunit: ^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0
- spatie/laravel-ray: ^1.29
This package is auto-updated.
Last update: 2025-02-09 12:52:40 UTC
README
A Laravel wrapper for SaasuConnect
Overview
This package can be imported into laravel to be able to make requests on the Saasu API.
Installation
composer require aleahy/laravel-saasu-connect
Then publish the config file to be able to access your saasu username, password and File ID.
php artisan vendor:publish --provider="Aleahy\LaravelSaasuConnect\ServiceProvider" --tag=config
Usage
Use the SaasuAPI facade to be able to make the calls on the Saasu API.
use Aleahy\LaravelSaasuConnect\Facade\SaasuAPI; use Aleahy\SaasuConnect\Entities\Invoice as SaasuInvoice; SaasuAPI::findEntity(SaasuInvoice::class, [ 'AmountOwed' => 490.0 ]);
Available Methods
The following methods currently exist:
findEntity
- Finds the provided entity with the search attributes. Returns a collection of entities.
insertEntity
- Makes a post request for the given entity with the provided attributes.
getEntity
- Returns the specific entity with the given id.
getAllEntities
- Returns all the entities in a single array.
Available Entities
- Company
- Contact
- Invoice
HasSaasuEntity Trait
Models can also be associated with a saasu id. This trait adds a SaasuEntity hasOne
relationship
which holds the saasu ID.
Adding the trait HasSaasuEntity
to your models assigns
them a model to manually track the saasu id.
Installation
Add the trait HasSaasuEntity
to your model.
You will also need to publish the migration to store the saasu id.
php artisan vendor:publish --provider="Aleahy\LaravelSaasuConnect\ServiceProvider" --tag=migrations
Available methods
setSaasuID
- set the value of the saasu id for the model.
getSaasuID
- returns the value of the saasu id for the model.
hasSaasuID
- returns true or false, depending on if the saasuID value has been set.