added api macros to request

This commit is contained in:
Denis Duliçi
2021-01-19 14:12:54 +03:00
parent 9269b93e3d
commit f7bc89806c
5 changed files with 14 additions and 4 deletions

View File

@ -13,7 +13,7 @@ if (!function_exists('user')) {
function user()
{
// Get user from api/web
if (request()->is('api/*')) {
if (request()->isApi()) {
$user = app('Dingo\Api\Auth\Auth')->user();
} else {
$user = auth()->user();