Skip to content

Instantly share code, notes, and snippets.

View OlabodeAbesin's full-sized avatar
🏠
Working from home

Ola Abesin OlabodeAbesin

🏠
Working from home
  • London
  • 18:56 (UTC +01:00)
View GitHub Profile
@OlabodeAbesin
OlabodeAbesin / gist:3a122fdd3bcbda7428f566a4bdf3f200
Created April 3, 2020 17:05
Quick teller Billers category
{
"categorys": [
{
"categoryid": "1",
"categoryname": "Utility Bills",
"categorydescription": "Pay your utility bills here"
},
{
"categoryid": "2",
"categoryname": "Cable TV Bills",
@OlabodeAbesin
OlabodeAbesin / medium.php
Created October 11, 2019 10:36
This gist is a php file that fetches your medium articles
<?php
require_once('guzzle/vendor/autoload.php');
use GuzzleHttp\Client;
function fetchMedium($yourusername)
{
$client = new Client();
Notifications::auth()->mobileNumberVerification($event->otp->phone, $event->otp); //Recommended
//Not recommended!
$client = new Client();
$response = $client->$method($baseUri . $requestUrl, [
'headers' => [],
'auth' => ['username', 'password'],
'json' => $formParams,
]);
@OlabodeAbesin
OlabodeAbesin / CollectorController.php
Created February 7, 2019 12:15
1. Require guzzle in composer json to make the call to github endpoint. 2. Make Collectorcontroller and add below contents 3. Add the web.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
class CollectorController extends Controller
{
@OlabodeAbesin
OlabodeAbesin / CollectorController.php
Created February 7, 2019 12:13
Require guzzle to make the call to github endpoint.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
class CollectorController extends Controller
{
<?php
namespace App\Http\Controllers\Api\Admin\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Validator;
use JWTFactory;
use JWTAuth;
use JWTAuthException;
<?php
namespace App\Http\Controllers\Api\User\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Validator;
use JWTFactory;
use JWTAuth;
use JWTAuthException;
//User Auth
Route::post('userlogin', 'Api\User\Auth\LoginController@login');
Route::post('userregister', 'Api\User\Auth\RegisterController@register');
//Admin Auth
Route::post('adminlogin', 'Api\Admin\Auth\LoginController@login');
Route::post('adminregister', 'Api\Admin\Auth\RegisterController@register');
//Here is the protected User Routes Group,
@OlabodeAbesin
OlabodeAbesin / Register_Jwt_middleware
Created January 8, 2019 15:52
Register_Jwt_middleware
protected $routeMiddleware = [
...
'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken',
'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken',
];
@OlabodeAbesin
OlabodeAbesin / Billing_api.php
Created October 19, 2018 21:24
Quick Billing api
public function passdata(){
$users = User::all();
foreach ($users as $key => $data) {
// $data = ["Id", 'username', 'mobile_number','amount_to_bill']
$this->Bill($data, $key);//The Bill function is called on every user data in the database.
}
}
public function Bill($data, $key){