访问 Alerts.LI API,为您的短信和电子邮件创建简短友好的网址。

2.0.2 2023-09-20 06:59 UTC

This package is auto-updated.

Last update: 2024-09-20 09:48:47 UTC


README

访问 Alerts.LI API,为您的短信和电子邮件创建简短友好的网址。

看看这个:https://www.tu-pagina-web.com/invlice/19503850/view

变成这个:www.alerts.li/LS3071

安装

使用包管理器 composer 安装 Alerst.li。

composer require yuniorhernandez/alertsli

使用方法

<?php

namespace App\Http\Controllers;

use App\Models\Invoice;
use Illuminate\Http\Request;
use Yuniorhernandez\Alertsli\Facades\Alertsli;

class InvoiceController extends Controller
{
    public function send_message(Invoice $invlice){
        // Link to include in the message
        $link = Alertsli::createLink([
            'title' => 'Link to Invoice',
            'url' => "https://www.your-web-page.com/invoice/" . $invlice . "/view",
            'description' => 'Link to invoice view.',
            'is_disabled' => false,
        ]);

        // Message
// Create a new link.
$link = Alertsli::createLink([
     'title' => 'Link title',
     'url' => "Destination URL, visitors will be directed to this address.",
     'description' => 'Link description, optional',
     'is_disabled' => false, //If it is true, the link will be deactivated.
 ]);
// return array
{
    "title": "Link to Invoice",
    "access_link": "http://alerts.li/L110034",
    "code": "L110034",
    "url": "https://www.your-web-page.com/invoice/AH7420HL004-20230917/view",
    "description": "Link to invoice view.",
    "is_disabled": 0,
    "created_at": "2023-09-16T16:26:39.000000Z",
    "updated_at": "2023-09-16T16:26:39.000000Z"
}
$options = [
    "per_page" => 25 // optional, intege between 1 / 100
    "order" => "asc" // optional, {'asc'. 'desc'} default:desc
    "page" => 2 // optional, navigate between pages if available
]
$links = Alertsli::getAll($options); // return array
$code = 'AL6399'; // Link code
$link = Alertsli::getLink($code); // return array
$code = 'AL6399'; // Link code
$data = [
    'title' => 'Link to Invoice',
    'url' => "https://www.your-web-page.com/invoice/" . $invlice . "/view",
    'description' => 'Link to invoice view.',
    'is_disabled' => false,
];
$link = Alertsli::updateLink($code, $data) // return array
$code = 'AL6399'; // Link code
$response = Alertsli::deleteLink($code) // return a message Acepted/Not found
$code = 'AL6399'; // Link code
$options = [
    "per_page" => 25 // optional, intege between 1 / 100
    "order" => "asc" // optional, {'asc'. 'desc'} default:desc
    "page" => 2 // optional, navigate between pages if available
]
$all_clicks = Alertsli::allClicks($code, $options) // return array

贡献

欢迎提交拉取请求。对于重大更改,请先打开一个问题来讨论您希望更改的内容。

请确保适当更新测试。

许可证

MIT