yedincisenol/dynamic-links

Firebase Dynamic Links for Php and Laravel

v2.0.0 2021-01-07 03:35 UTC

This package is auto-updated.

Last update: 2024-11-07 12:23:42 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