smskin/clico

PHP interface for cli.co url shorter service

Maintainers

Details

github.com/smskin/clico

Source

Issues

Installs: 528

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/smskin/clico

0.0.1 2020-10-16 18:32 UTC

This package is auto-updated.

Last update: 2025-09-17 06:03:46 UTC


README

Installation

Laravel

  • composer require smskin/clico
  • add lines to the config/services.php
'clico' => [
    'api_token'=>env('CLICO_API_TOKEN','')
]
  • add CLICO_API_TOKEN to .env file
CLICO_API_TOKEN=[API TOKEN]
  • You can use the CliCo facade
try {
    $link = CliCo::singleLink(
	    (new LinkRequest())
            ->setTargetUrl('https://msk.wed-expert.com')
            ->setUtm(
                (new UtmModel())
                    ->setPhone('7911111111111')
                )
            );
} catch (HttpException $exception){
	dd($exception);
} catch (ValidationException $exception){
    dd($exception);
}

Any PHP service

  • composer require smskin/clico
  • You can use the library as any class
try {
    $link = (new CliCo(
        '[API TOKEN]'
    ))->singleLink(
        (new LinkRequest())
            ->setTargetUrl('https://msk.wed-expert.com')
            ->setUtm(
                (new UtmModel())
                    ->setPhone('7911111111111')
                )
            );
} catch (HttpException $exception){
    dd($exception);
} catch (ValidationException $exception){
    dd($exception);
}

Using

  • singleLink
  • multipleLinks