yedincisenol/dynamic-links

Firebase Dynamic Links for Php and Laravel

1.2.4 2018-07-26 16:06 UTC

README

Travis Packagist Packagist Packagist

Create Firebase Dynamic Links from Php and Laravel

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