Skip to content

Instantly share code, notes, and snippets.

@nguyenphuocnhatthanh
nguyenphuocnhatthanh / AbstractNotification.php
Created June 14, 2018 07:20
Abstact Notification Firebase
<?php
namespace App\Services\PushNotification;
use App\Services\DeviceToken;
use App\Services\FirebaseCloudMessage;
abstract class AbstractNotification
{
/**
* @var FirebaseCloudMessage
@nguyenphuocnhatthanh
nguyenphuocnhatthanh / firebase.php
Created June 14, 2018 06:41
Firebase cloud php
<?php
namespace App\Services;
use GuzzleHttp\Client;
class FirebaseCloudMessage
{
/**
* @var Client
*/
<?php
namespace App\Services\Social;
use App\Exceptions\FurusatoException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
class FacebookService extends AbstractSocial
{
@nguyenphuocnhatthanh
nguyenphuocnhatthanh / example.php
Created May 8, 2017 03:10
Call social service
<?php
return (new SocialAccountService($params['provider']))->firstOrCreate($params);
<?php
namespace App\Services\Social;
use App\Exceptions\FurusatoException;
use App\Repositories\UserDeviceRepository;
use App\Repositories\UserRepository;
use Carbon\Carbon;
use DB;
use App\Models\User;
@nguyenphuocnhatthanh
nguyenphuocnhatthanh / AbstractSocial.php
Created March 23, 2017 04:33
Abstract class Social
<?php
namespace App\Services\Social;
abstract class AbstractSocial
{
/**
* Return user data
*
* @param $token
@nguyenphuocnhatthanh
nguyenphuocnhatthanh / twitter.php
Last active March 23, 2017 03:59
Login Twitter API with Oauth1
<?php
namespace App\Services\Social;
use App\Services\Social\Contrast\TwitterServiceInterface;
use League\OAuth1\Client\Credentials\TokenCredentials;
use League\OAuth1\Client\Server\Server;
class TwitterService extends AbstractSocial implements TwitterServiceInterface
{
/**