[Updated: Category locale request issue(using API, GraphQL) fixed.]

This commit is contained in:
Vivek 2021-12-03 19:41:27 +05:30
parent f4a32baf45
commit 819f1ff032
2 changed files with 23 additions and 2 deletions

View File

@ -300,7 +300,7 @@ class CategoryRepository extends Repository
foreach (core()->getAllLocales() as $locale) {
foreach ($model->translatedAttributes as $attribute) {
if ($attribute === $attributeName) {
$data[$locale->code][$attribute] = $data[$requestedLocale][$attribute];
$data[$locale->code][$attribute] = isset($data[$requestedLocale][$attribute]) ?: $data[$data['locale']][$attribute];
}
}
}

View File

@ -8,8 +8,9 @@ use Illuminate\Notifications\Notifiable;
use Webkul\User\Contracts\Admin as AdminContract;
use Webkul\User\Database\Factories\AdminFactory;
use Webkul\User\Notifications\AdminResetPassword;
use Tymon\JWTAuth\Contracts\JWTSubject;
class Admin extends Authenticatable implements AdminContract
class Admin extends Authenticatable implements AdminContract, JWTSubject
{
use HasFactory, Notifiable;
@ -83,4 +84,24 @@ class Admin extends Authenticatable implements AdminContract
{
return AdminFactory::new();
}
/**
* Get the identifier that will be stored in the subject claim of the JWT.
*
* @return mixed
*/
public function getJWTIdentifier()
{
return $this->getKey();
}
/**
* Return a key value array, containing any custom claims to be added to the JWT.
*
* @return array
*/
public function getJWTCustomClaims()
{
return [];
}
}