BayLinks PHP SDK for Laravel framework.
BayLinks is a powerful URL shortening and management platform tailored for modern businesses. As a Software as a Service (SaaS) solution, BayLinks empowers organizations to create, customize, and track short links effortlessly. Perfect for marketing campaigns, email newsletters, and internal communications, BayLinks simplifies link sharing and enhances brand visibility. With robust analytics and customizable branding options, BayLinks is the go-to solution for businesses seeking efficient link management and optimization.
You can install the package via composer:
composer require palpalani/baylinks-laravel
You can publish the config file with:
php artisan vendor:publish --tag="baylinks-laravel-config"
Update the server information:
return [
/**
* BayLinks URL.
*/
'server' => env('BAYLINKS_SERVER'),
/**
* Rest API version of BayLinks.
*/
'api' => [
'url' => 'api/v1',
],
];
Get the account Information:
$bayLinks = BayLinks::client();
$bayLinks->accountDetails()->get(<BAYLINKS_API_KEY>);
Create a Single Short URL:
$bayLinks->createShortURL()
->post(<BAYLINKS_API_KEY>,
[
"destination" => "<Source URL>", // required
"domain" => "<Custom domain>" // optional
]
);
Create a Bulk Short URL:
$bayLinks->createBulkURL()
->post(<BAYLINKS_API_KEY>,
[
"destination": [ // required
"<Source URL>",
"<Source URL>"
.
.
"<Source URL>"
],
"domain": "<Custom domain>",// optional
"planet": "jupiter", // optional
"expire": 0, // optional
"tag": [] // optional callback data
]
);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.