1. Go to this page and download the library: Download support/remote-auth library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
support / remote-auth example snippets
config/app.php
config/app.php
php artisan vendor:publish
RemoteAuth.php
php artisan key:generate
php artisan config:cache
php artisan make:middleware RemoteAuth
namespace App\Http\Middleware;
use Closure;
use Remote;
class RemoteAuth
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
/*check token is received or not*/
if(empty($request->header('Authorization'))){
return response()->json(array('token is
public function get_detail(Request $request){
//get user
$user = $request->r_user;
//token
$token = $request->r_token;
dd($user); //dump $user variable
}