%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/camillo/camillo-api-master/app/Traits/
Upload File :
Create Path :
Current File : /var/www/html/camillo/camillo-api-master/app/Traits/ApiUser.php

<?php

namespace App\Traits;

use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;

trait ApiUser
{
    public function getLoggedUser(){
        $user = auth('api')->user();

        if(!$user){
            throw new HttpException(Response::HTTP_UNAUTHORIZED, __('user_not_found'));
        }

        return $user;
    }
}


Zerion Mini Shell 1.0