from: @Israel Pereira

1. First Steps

  1. You can start using this package in your Laravel application by installing it via composer:
composer require signifly/laravel-struct
  1. Next, you need to publish the config file:
php artisan vendor:publish --tag="struct"
  1. And finally, add the following keys to your .env file and their respective values:
STRUCT_URL=
STRUCT_TOKEN=

These values can be obtained from your Struct dashboard.

No class instantiation is required. After publishing the necessary files (item 1.2) and filling in the information in your .env file (item 1.3), you are ready to use it.

2. Next Steps

This package was written to interact with the Struct API in a way familiar to Laravel developers.

Start by importing the class (entity) you want to use in your application:

use Signifly\\Struct\\Api\\Product\\Product as StructProduct;

...

public function index()
{
    return StructProduct::all();
}

public function show(int $id)
{
    return StructProduct::show(id: $id);
}