Skip to content

Instantly share code, notes, and snippets.

View orobogenius's full-sized avatar
🏠
Remote

Lucky Ozoka orobogenius

🏠
Remote
View GitHub Profile
<?php
//As would be defined in bootstrap.php
defined('HOST_NAME') OR define('HOST_NAME', $SERVER['SERVER_NAME']);
if (!function_exists('asset')) {
/**
* Generate an asset path
*
@orobogenius
orobogenius / AppServiceProvider.php
Last active February 3, 2019 18:38
Extending Laravel's Validator
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Verifiers\RedisPresenceVerifier;
class AppServiceProvider extends ServiceProvider
{
/**
@orobogenius
orobogenius / RedisPresenceVerifier.php
Created February 2, 2019 22:51
Extending Laravel's Validator
<?php
namespace App\Verifiers;
use Illuminate\Contracts\Redis\Factory;
use Illuminate\Validation\PresenceVerifierInterface;
class RedisPresenceVerifier implements PresenceVerifierInterface
{
/**
@orobogenius
orobogenius / SmsServiceProvider.php
Created February 20, 2019 19:55
ServiceProvider for SMS Component
<?php
namespace App\Providers;
use App\Components\Sms\SmsManager;
use Illuminate\Support\ServiceProvider;
class SmsServiceProvider extends ServiceProvider
{
/**
@orobogenius
orobogenius / SmsManager.php
Created February 20, 2019 20:00
The Manager class for the SMS Component.
<?php
namespace App\Components\Sms;
use Illuminate\Support\Manager;
use Nexmo\Client as NexmoClient;
use Twilio\Rest\Client as TwilioClient;
use App\Components\Sms\Drivers\NullDriver;
use App\Components\Sms\Drivers\NexmoDriver;
use App\Components\Sms\Drivers\TwilioDriver;
<?php
return [
/*
|--------------------------------------------------------------------------
| The default SMS Driver
|--------------------------------------------------------------------------
|
| The default sms driver to use as a fallback when no driver is specified
<?php
namespace App\Components\Sms\Drivers;
use Nexmo\Client as NexmoClient;
class NexmoDriver extends Driver
{
/**
* The Nexmo client.
@orobogenius
orobogenius / SmsComponentTest.php
Last active October 27, 2022 07:33
Test to verify that the custom component is able to use multiple drivers.
<?php
namespace Tests\Unit;
use SMS;
use Tests\TestCase;
use App\Components\Sms\Drivers\NexmoDriver;
use App\Components\Sms\Drivers\TwilioDriver;
use App\Components\Sms\Drivers\NullDriver;
use App\Components\Sms\Contracts\SMS as SmsContract;
<?php
namespace App\OAuth\Bridge\Grant;
use DateInterval;
use League\OAuth2\Server\RequestEvent;
use App\OAuth\SocialUserProviderInterface;
use Psr\Http\Message\ServerRequestInterface;
use League\OAuth2\Server\Grant\AbstractGrant;
use League\OAuth2\Server\Entities\UserEntityInterface;
<?php
namespace App\OAuth;
interface SocialUserProviderInterface
{
/**
* Get a social user from the provider by their access token.
*
* @param string $provider