yedincisenol / dynamic-links by yedincisenol

Firebase Dynamic Links for Php and Laravel
354,728
27
5
Package Data
Maintainer Username: yedincisenol
Maintainer Contact: o@yedincisenol.com (Ibrahim S. Orencik)
Package Create Date: 2017-09-27
Package Last Update: 2021-01-07
Home Page: http://yeni.co
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:20:31
Package Statistics
Total Downloads: 354,728
Monthly Downloads: 4,424
Daily Downloads: 170
Total Stars: 27
Total Watchers: 5
Total Forks: 16
Total Open Issues: 0

Travis Packagist Packagist Packagist

Create Firebase Dynamic Links from Php and Laravel

  • Php Installation
  • Configuration
  • Laravel Installation
  • Usage examples

Php Install

composer require "yedincisenol/dynamic-links"

Php Config

$dynamicLink = new yedincisenol\DynamicLinks\DynamicLinks([
    'api_key'               =>  'apiKeyFromFirebaseProject',
    'dynamic_link_domain'   =>  'dynami-domain-from-dynamic-links.goo.gl
]);

Laravel Install

  • Add composer
composer require "yedincisenol/dynamic-links"
  • Add service provider (For Laravel 5.6 before) config/app.php
'providers' => [
    yedincisenol\DynamicLinks\LaravelServiceProvider::class
],
  • Fill Environments

copy theese parameters to your project .env and fill

FIREBASE_API_KEY=
FIREBASE_DYNAMIC_LINKS_DOMAIN=
  • Laravel Usage
$link = new yedincisenol\DynamicLinks\DynamicLink('http://yeni.co/');
$shortLink = $dynamicLink->create($link, 'UNGUESSABLE');
  • Publish Config file Publish Config for Laravel
php artisan vendor:publish --tag=dynamic-links

Usage

$dynamicLink = new yedincisenol\DynamicLinks\DynamicLinks([
    'api_key'               =>  $apiKey,
    'dynamic_link_domain'   =>  $dynamicLinkDomain
]);

$link = new yedincisenol\DynamicLinks\DynamicLink('http://yeni.co/');
$shortLink = $dynamicLink->create($link, 'UNGUESSABLE');

Advanced usage: example.php

Test

Run

phpunit