This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"categorys": [ | |
{ | |
"categoryid": "1", | |
"categoryname": "Utility Bills", | |
"categorydescription": "Pay your utility bills here" | |
}, | |
{ | |
"categoryid": "2", | |
"categoryname": "Cable TV Bills", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('guzzle/vendor/autoload.php'); | |
use GuzzleHttp\Client; | |
function fetchMedium($yourusername) | |
{ | |
$client = new Client(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use GuzzleHttp\Exception\GuzzleException; | |
use GuzzleHttp\Client; | |
class CollectorController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use GuzzleHttp\Exception\GuzzleException; | |
use GuzzleHttp\Client; | |
class CollectorController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected $routeMiddleware = [ | |
... | |
'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken', | |
'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken', | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |