File tree Expand file tree Collapse file tree 8 files changed +55
-42
lines changed
packages/Webkul/Admin/src
Http/Controllers/Settings Expand file tree Collapse file tree 8 files changed +55
-42
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ public function destroy(int $id): JsonResponse
102
102
{
103
103
$ group = $ this ->groupRepository ->findOrFail ($ id );
104
104
105
+ if ($ group ->users ()->exists ()) {
106
+ return response ()->json ([
107
+ 'message ' => trans ('admin::app.settings.groups.index.delete-failed-associated-users ' ),
108
+ ], 400 );
109
+ }
110
+
105
111
try {
106
112
Event::dispatch ('settings.group.delete.before ' , $ id );
107
113
Original file line number Diff line number Diff line change 747
747
748
748
'groups ' => [
749
749
'index ' => [
750
- 'create-btn ' => 'إنشاء مجموعة ' ,
751
- 'title ' => 'المجموعات ' ,
752
- 'create-success ' => 'تم إنشاء المجموعة بنجاح. ' ,
753
- 'update-success ' => 'تم تحديث المجموعة بنجاح. ' ,
754
- 'destroy-success ' => 'تم حذف المجموعة بنجاح. ' ,
755
- 'delete-failed ' => 'لا يمكن حذف المجموعة. ' ,
750
+ 'create-btn ' => 'إنشاء مجموعة ' ,
751
+ 'title ' => 'المجموعات ' ,
752
+ 'create-success ' => 'تم إنشاء المجموعة بنجاح. ' ,
753
+ 'update-success ' => 'تم تحديث المجموعة بنجاح. ' ,
754
+ 'destroy-success ' => 'تم حذف المجموعة بنجاح. ' ,
755
+ 'delete-failed ' => 'لا يمكن حذف المجموعة. ' ,
756
+ 'delete-failed-associated-users ' => 'لا يمكن حذف المجموعة لأنها مستخدمة من قبل المستخدمين. ' ,
756
757
757
758
'datagrid ' => [
758
759
'delete ' => 'حذف ' ,
Original file line number Diff line number Diff line change 749
749
750
750
'groups ' => [
751
751
'index ' => [
752
- 'create-btn ' => 'Create Group ' ,
753
- 'title ' => 'Groups ' ,
754
- 'create-success ' => 'Group created successfully. ' ,
755
- 'update-success ' => 'Group updated successfully. ' ,
756
- 'destroy-success ' => 'Group deleted successfully. ' ,
757
- 'delete-failed ' => 'Group can not be deleted. ' ,
752
+ 'create-btn ' => 'Create Group ' ,
753
+ 'title ' => 'Groups ' ,
754
+ 'create-success ' => 'Group created successfully. ' ,
755
+ 'update-success ' => 'Group updated successfully. ' ,
756
+ 'destroy-success ' => 'Group deleted successfully. ' ,
757
+ 'delete-failed ' => 'Group can not be deleted. ' ,
758
+ 'delete-failed-associated-users ' => 'Group can not be deleted, as this is being used by users. ' ,
758
759
759
760
'datagrid ' => [
760
761
'delete ' => 'Delete ' ,
Original file line number Diff line number Diff line change 751
751
752
752
'groups ' => [
753
753
'index ' => [
754
- 'create-btn ' => 'Crear Grupo ' ,
755
- 'title ' => 'Grupos ' ,
756
- 'create-success ' => 'Grupo creado con éxito. ' ,
757
- 'update-success ' => 'Grupo actualizado con éxito. ' ,
758
- 'destroy-success ' => 'Grupo eliminado con éxito. ' ,
759
- 'delete-failed ' => 'No se puede eliminar el grupo. ' ,
754
+ 'create-btn ' => 'Crear Grupo ' ,
755
+ 'title ' => 'Grupos ' ,
756
+ 'create-success ' => 'Grupo creado con éxito. ' ,
757
+ 'update-success ' => 'Grupo actualizado con éxito. ' ,
758
+ 'destroy-success ' => 'Grupo eliminado con éxito. ' ,
759
+ 'delete-failed ' => 'No se puede eliminar el grupo. ' ,
760
+ 'delete-failed-associated-users ' => 'No se puede eliminar el grupo, ya que está siendo utilizado por usuarios. ' ,
760
761
761
762
'datagrid ' => [
762
763
'delete ' => 'Eliminar ' ,
Original file line number Diff line number Diff line change 752
752
753
753
'groups ' => [
754
754
'index ' => [
755
- 'create-btn ' => 'ایجاد گروه ' ,
756
- 'title ' => 'گروهها ' ,
757
- 'create-success ' => 'گروه با موفقیت ایجاد شد. ' ,
758
- 'update-success ' => 'گروه با موفقیت بهروزرسانی شد. ' ,
759
- 'destroy-success ' => 'گروه با موفقیت حذف شد. ' ,
760
- 'delete-failed ' => 'گروه قابل حذف نیست. ' ,
755
+ 'create-btn ' => 'ایجاد گروه ' ,
756
+ 'title ' => 'گروهها ' ,
757
+ 'create-success ' => 'گروه با موفقیت ایجاد شد. ' ,
758
+ 'update-success ' => 'گروه با موفقیت بهروزرسانی شد. ' ,
759
+ 'destroy-success ' => 'گروه با موفقیت حذف شد. ' ,
760
+ 'delete-failed ' => 'امکان حذف گروه وجود ندارد. ' ,
761
+ 'delete-failed-associated-users ' => 'امکان حذف گروه وجود ندارد زیرا توسط کاربران استفاده میشود. ' ,
761
762
762
763
'datagrid ' => [
763
764
'delete ' => 'حذف ' ,
Original file line number Diff line number Diff line change 745
745
746
746
'groups ' => [
747
747
'index ' => [
748
- 'create-btn ' => 'Adicionar Grupo ' ,
749
- 'title ' => 'Grupos ' ,
750
- 'create-success ' => 'Grupo adicionado com sucesso. ' ,
751
- 'update-success ' => 'Grupo atualizado com sucesso. ' ,
752
- 'destroy-success ' => 'Grupo excluído com sucesso. ' ,
753
- 'delete-failed ' => 'Não foi possível excluir o grupo. ' ,
748
+ 'create-btn ' => 'Criar Grupo ' ,
749
+ 'title ' => 'Grupos ' ,
750
+ 'create-success ' => 'Grupo criado com sucesso. ' ,
751
+ 'update-success ' => 'Grupo atualizado com sucesso. ' ,
752
+ 'destroy-success ' => 'Grupo excluído com sucesso. ' ,
753
+ 'delete-failed ' => 'Não foi possível excluir o grupo. ' ,
754
+ 'delete-failed-associated-users ' => 'Não foi possível excluir o grupo, pois está sendo utilizado por usuários. ' ,
754
755
755
756
'datagrid ' => [
756
757
'delete ' => 'Excluir ' ,
Original file line number Diff line number Diff line change 751
751
752
752
'groups ' => [
753
753
'index ' => [
754
- 'create-btn ' => 'Grup Oluştur ' ,
755
- 'title ' => 'Gruplar ' ,
756
- 'create-success ' => 'Grup başarıyla oluşturuldu. ' ,
757
- 'update-success ' => 'Grup başarıyla güncellendi. ' ,
758
- 'destroy-success ' => 'Grup başarıyla silindi. ' ,
759
- 'delete-failed ' => 'Grup silinemedi. ' ,
754
+ 'create-btn ' => 'Grup Oluştur ' ,
755
+ 'title ' => 'Gruplar ' ,
756
+ 'create-success ' => 'Grup başarıyla oluşturuldu. ' ,
757
+ 'update-success ' => 'Grup başarıyla güncellendi. ' ,
758
+ 'destroy-success ' => 'Grup başarıyla silindi. ' ,
759
+ 'delete-failed ' => 'Grup silinemedi. ' ,
760
+ 'delete-failed-associated-users ' => 'Grup silinemiyor, çünkü kullanıcılar tarafından kullanılıyor. ' ,
760
761
761
762
'datagrid ' => [
762
763
'delete ' => 'Sil ' ,
Original file line number Diff line number Diff line change 748
748
749
749
'groups ' => [
750
750
'index ' => [
751
- 'create-btn ' => 'Tạo Nhóm ' ,
752
- 'title ' => 'Nhóm ' ,
753
- 'create-success ' => 'Nhóm đã được tạo thành công. ' ,
754
- 'update-success ' => 'Nhóm đã được cập nhật thành công. ' ,
755
- 'destroy-success ' => 'Nhóm đã được xóa thành công. ' ,
756
- 'delete-failed ' => 'Không thể xóa nhóm. ' ,
751
+ 'create-btn ' => 'Tạo Nhóm ' ,
752
+ 'title ' => 'Nhóm ' ,
753
+ 'create-success ' => 'Tạo nhóm thành công. ' ,
754
+ 'update-success ' => 'Cập nhật nhóm thành công. ' ,
755
+ 'destroy-success ' => 'Xóa nhóm thành công. ' ,
756
+ 'delete-failed ' => 'Không thể xóa nhóm. ' ,
757
+ 'delete-failed-associated-users ' => 'Không thể xóa nhóm vì đang được sử dụng bởi người dùng. ' ,
757
758
758
759
'datagrid ' => [
759
760
'delete ' => 'Xóa ' ,
You can’t perform that action at this time.
0 commit comments