I would like to ask you to transfer headre to token and then Could not get any response.

routing:

 //
    Route::post("api/:version/address$","api/:version.Address/createOrUpdateAddress");

constroller:

//create Or update userAddress
    public function createOrUpdateAddress() {
//        (new AddressNew())->goCheck();
        $validate = new AddressNew();
        $validate->goCheck();
        // Tokenuid
        // uid,,else throw error
        //
        // or

        $uid = TokenService::getCurrentUID();

        $user = UserModel::get($uid);
        if (!$user) {
            throw new UserException();
        }

        $dataArray = $validate->getDateByRule(input("post."));

        $userAddress = $user->address;
        if (!$userAddress) {
            $user->address()->save($dataArray);
        }else{
            $user->address->save($dataArray); //!
        }
        return new SuccessMessage();
        $token = Request::instance()->header("token");
        return $token;
    }


controller:


token 27b61d0911c476f1318a0511723ac641



token
116f13

Jul.06,2022

has been solved, the coding problem


this problem of the landlord is very simple, as long as you are willing to charge money can be solved, charging money will make you stronger.

Menu