When you are working with an external API, and need to syncronize clients, products, services, categories or like, this package help you to store the external id for all the models you want.
This package provides a HasExternalId
trait that, once installed on a model, allows you to do things like this:
// Store (update or create) the external id
$model->addExternalId('external_unique_id');
// Remove/unlink an external ID
$model->removeExternalId();
// Get the external ID
$model->getExternalID();
// Get all external information
$model->external()
You can install the package via composer:
composer require eeappdev/laravel-external-id
You must publish the migration with:
php artisan vendor:publish --provider="Eeappdev\ExternalId\ExternalIdServiceProvider" --tag="migrations"
Migrate the external_ids
table:
php artisan migrate
Add the HasExternalId
trait to a model you like to use external relationships on.
use Eeappdev\ExternalId\HasExternalId;
class Client extends Model
{
use HasExternalId;
The MIT License (MIT). Please see License File for more information.