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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- load jQuery --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<!-- provide the csrf token --> | |
<meta name="csrf-token" content="{{ csrf_token() }}" /> |
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){ |
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
//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
<?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
<?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; | |
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
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 | |
require_once('guzzle/vendor/autoload.php'); | |
use GuzzleHttp\Client; | |
function fetchMedium($yourusername) | |
{ | |
$client = new Client(); |
OlderNewer