common/modules/api_v1/v1/ApiService/Auth.php
/**
    * Generate Token Method,use as Midelware
    * Token expiration time is 8 hour
    */
Generate Token Method,use as Midelware
Token expiration time is 8 hour
Generate Token Method use as Midelware Token expiration time is 8 hour
public function GenerateToken(){
        $carbon = new Carbon();
        $api_user = new ApiUser;
        $api_user->token = $api_user->generateRandomToken();
        $api_user->refresh_token = $api_user->generateRandomToken();
        $api_user->expiration_date = $carbon->addHours(8);
        if($api_user->save()){
            return ['message'=>'success','token'=>$api_user->token,'refresh_token'=>$api_user->refresh_token,'expires'=>$api_user->expiration_date];
        }
    }
public function GenerateToken ( ) { $ carbon = new Carbon ( ) ; $ api_user = new ApiUser ; $ api_user -> token = $ api_user -> generateRandomToken ( ) ; $ api_user -> refresh_token = $ api_user -> generateRandomToken ( ) ; $ api_user -> expiration_date = $ carbon -> addHours ( 8 ) ; if ( $ api_user -> save ( ) ) { return [ 'message' => 'success' , 'token' => $ api_user -> token , 'refresh_token' => $ api_user -> refresh_token , 'expires' => $ api_user -> expiration_date ] ; } }
Generate Token Method,use as Midelware
 Token expiration time is 8 hour
Generate Token Method use as Midelware Token expiration time is 8 hour