You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
willaengine/app/CorePackages/Authenticate/AuthFinder.php

28 lines
440 B

<?php
namespace App\CorePackages\Authenticate;
class AuthFinder
{
public static function user() {
if (auth()->check()) {
return auth()->user();
} elseif (auth('api')->check()) {
return auth('api')->user();
}
return null;
}
public static function check() {
if (auth()->check() || auth('api')->check()) {
return true;
}
return false;
}
}