[Updated: Category locale request issue(using API, GraphQL) fixed.]
This commit is contained in:
parent
f4a32baf45
commit
819f1ff032
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue