Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Refactor #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/Webkul/Notify/src/DataGrids/NotifyDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public function prepareColumns()
'filterable' => false,
]);



$this->addColumn([
'index' => 'customer_name',
'label' => trans('notify::app.admin.customer_name'),
Expand All @@ -75,7 +73,6 @@ public function prepareColumns()
'filterable' => false,
]);


$this->addColumn([
'index' => 'created_at',
'label' => trans('notify::app.admin.add_date'),
Expand All @@ -92,9 +89,6 @@ public function prepareColumns()
'searchable' => true,
'sortable' => true,
'filterable' => false,
'closure' => function ($value) {
return '<a href="" class="secondary-button" data-product-id="' . $value->id . '" onclick="sendQuickMail(' . $value->id . ')">' . trans('notify::app.admin.send_notification') . '</a>';
},
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ public function store(Request $request)
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View
*/
public function updateStockStatus(Request $request)
public function send_notification()
{
$notificationId = $request->notificationId;

try {
$data = $this->notifyRepository->find($notificationId);
$data = $this->notifyRepository->find(request()->input('id'));

$customer = $this->customerRepository->find($data->customer_id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Webkul\Notify\Http\Controllers\Shop;

use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Webkul\Notify\Http\Controllers\Controller;
use Webkul\Notify\Repository\NotifyRepository;

Expand All @@ -23,11 +23,15 @@ public function __construct(protected NotifyRepository $notifyRepository)
*
* @return \Illuminate\View\View
*/
public function store(Request $request)
public function store() :JsonResponse
{
$this->notifyRepository->create([
'product_id' => $request->product_id,
'customer_id' => $request->customer_id,
'product_id' => request()->input('product_id'),
'customer_id' => request()->input('customer_id'),
]);

return new JsonResponse([
'message' => trans('notify::app.shop.message'),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ class NotifyServiceProvider extends ServiceProvider
public function boot()
{

$this->publishes([__DIR__ . '/../Resources/views/products/view.blade.php' => ('packages/Webkul/Shop/src/Resources/views/products/view.blade.php')]);

$this->app->register(ModuleServiceProvider::class);

$this->app->register(EventServiceProvider::class);

$this->loadMigrationsFrom(__DIR__ .'/../Database/Migrations');
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');

$this->loadRoutesFrom(__DIR__ . '/../Routes/admin-routes.php');

Expand All @@ -42,7 +44,8 @@ public function boot()
public function register()
{
$this->mergeConfigFrom(
dirname(__DIR__) . '/Config/admin-menu.php', 'menu.admin'
dirname(__DIR__) . '/Config/admin-menu.php',
'menu.admin'
);
}
}
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'الهوية',
'product_name' => 'اسم المنتج',
'customer_name' => 'اسم العميل',
'add_date' => 'إضافة التاريخ',
'send_notification' => 'إرسال إشعار',
],

'shop' => [
'message' => 'سنعلمك قريباً',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/bn/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'আইডি',
'product_name' => 'পণ্যের নাম',
'customer_name' => 'গ্রাহকের নাম',
'add_date' => 'তারিখ যোগ করুন',
'send_notification' => 'বিজ্ঞপ্তি প্রেরণ করুন',
],

'shop' => [
'message' => 'আমরা শীঘ্রই আপনাকে জানাবো',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/de/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Produktname',
'customer_name' => 'Kundenname',
'add_date' => 'Datum hinzufügen',
'send_notification' => 'Benachrichtigung senden',
],

'shop' => [
'message' => 'Wir werden Sie bald benachrichtigen',
]
];
4 changes: 4 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/en/app.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
'customer_name' => 'Customer Name',
'add_date' => 'Add Date',
'send_notification' => 'Send Notification',
],

'shop' => [
'message' => 'We will notify you soon',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Nombre del Producto',
'customer_name' => 'Nombre del Cliente',
'add_date' => 'Agregar Fecha',
'send_notification' => 'Enviar Notificación',
],

'shop' => [
'message' => 'Le notificaremos pronto',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'شناسه',
'product_name' => 'نام محصول',
'customer_name' => 'نام مشتری',
'add_date' => 'تاریخ افزودن',
'send_notification' => 'ارسال اطلاعیه',
],

'shop' => [
'message' => 'به زودی به شما اطلاع خواهیم داد',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/fr/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Nom du Produit',
'customer_name' => 'Nom du Client',
'add_date' => 'Ajouter une Date',
'send_notification' => 'Envoyer une Notification',
],

'shop' => [
'message' => 'Nous vous notifierons bientôt',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/he/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'מזהה',
'product_name' => 'שם המוצר',
'customer_name' => 'שם הלקוח',
'add_date' => 'הוסף תאריך',
'send_notification' => 'שלח הודעה',
],

'shop' => [
'message' => 'נודיע לך בקרוב',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/hi_IN/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'आईडी',
'product_name' => 'प्रोडक्ट नाम',
'customer_name' => 'ग्राहक का नाम',
'add_date' => 'तारीख जोड़ें',
'send_notification' => 'सूचना भेजें',
],

'shop' => [
'message' => 'हम आपको जल्दी ही सूचित करेंगे',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/it/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Nome Prodotto',
'customer_name' => 'Nome Cliente',
'add_date' => 'Aggiungi Data',
'send_notification' => 'Invia Notifica',
],

'shop' => [
'message' => 'Ti avviseremo presto',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/ja/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => '製品名',
'customer_name' => '顧客名',
'add_date' => '日付を追加',
'send_notification' => '通知を送信',
],

'shop' => [
'message' => '近くお知らせします',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/nl/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Productnaam',
'customer_name' => 'Naam klant',
'add_date' => 'Datum toevoegen',
'send_notification' => 'Notificatie versturen',
],

'shop' => [
'message' => 'We zullen u binnenkort op de hoogte stellen',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/pl/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Nazwa Produktu',
'customer_name' => 'Imię Klienta',
'add_date' => 'Dodaj Datę',
'send_notification' => 'Wyślij Powiadomienie',
],

'shop' => [
'message' => 'Powiadomimy Cię wkrótce',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/pt_BR/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ID',
'product_name' => 'Nome do Produto',
'customer_name' => 'Nome do Cliente',
'add_date' => 'Adicionar Data',
'send_notification' => 'Enviar Notificação',
],

'shop' => [
'message' => 'Notificaremos você em breve',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/ru/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ИД',
'product_name' => 'Название продукта',
'customer_name' => 'Имя клиента',
'add_date' => 'Добавить дату',
'send_notification' => 'Отправить уведомление',
],

'shop' => [
'message' => 'Мы скоро вас уведомим',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/sin/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'අංකය',
'product_name' => 'නිෂ්පාදන නාමය',
'customer_name' => 'සැපයුම්කරුවේ නම',
'add_date' => 'දිනය එකතු කරන්න',
'send_notification' => 'ස්ථාවර යවන්න',
],

'shop' => [
'message' => 'වැඩිදුර ඔබට කියවා ඇත',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/tr/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'Kimlik',
'product_name' => 'Ürün Adı',
'customer_name' => 'Müşteri Adı',
'add_date' => 'Tarih Ekle',
'send_notification' => 'Bildirim Gönder',
],

'shop' => [
'message' => 'Sizi yakında bilgilendireceğiz',
]
];
15 changes: 15 additions & 0 deletions packages/Webkul/Notify/src/Resources/lang/uk/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
'admin' => [
'id' => 'ІД',
'product_name' => 'Назва продукту',
'customer_name' => 'Імя клієнта',
'add_date' => 'Додати дату',
'send_notification' => 'Надіслати сповіщення',
],

'shop' => [
'message' => 'Ми сповістимо вас найближчим часом',
]
];
Loading