Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/Console.zip
Назад
PK !>�Z�.�= = Kernel.phpnu �[��� <?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * Define the application's command schedule. */ protected function schedule(Schedule $schedule): void { // $schedule->command('inspire')->hourly(); } /** * Register the commands for the application. */ protected function commands(): void { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } } PK !>�Z]�_!� � , Commands/SendOrderArtworkReminderCommand.phpnu �[��� <?php namespace App\Console\Commands; use App\Models\Order; use App\Models\OrderArtworkReminder; use App\Models\SiteSetting; use App\Notifications\OrderArtworkReminderNotification; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; class SendOrderArtworkReminderCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'email:send-order-artwork-reminder'; /** * The console command description. * * @var string */ protected $description = 'Send email every 8 hours to users waiting on order.'; public function handle(): void { if (!now()->isWeekend()) { $orders = OrderArtworkReminder::all(); $company_phone_1 = SiteSetting::where('key', 'Site Phone')->first(); $company_phone_2 = SiteSetting::where('key', 'Site Phone 2')->first(); foreach ($orders as $key => $order) { $db_order = Order::find($order->order_id); $approve_url = config('app.react_app_artwork_approve_url'); $templates = $attachments = []; foreach ($db_order->items as $item) { if (!empty($item->template)) { $templates[] = '<li style="text-align: center; list-style: none"><strong><a href="' . asset('storage/order/' . $item->template) . '" style="text-decoration: underline; font-size: 25px; color: blue"><u>CLICK HERE TO VIEW ARTWORK</u></a></strong></li>'; $attachments[] = $item->templateUrl; } } $data = [ 'order_number' => $order->order_number, 'user' => $order->user, 'notes' => $order->notes, 'approve_url' => $approve_url . $order->order_id, 'templates' => $templates, 'company_phone_1' => $company_phone_1->value ?? "N/A", 'company_phone_2' => $company_phone_2->value ?? "N/A", 'attachments' => $attachments, ]; $order->user->notify((new OrderArtworkReminderNotification($data))->delay(now()->addSeconds($key))); Log::channel('cron_jobs') ->info('Order artwork reminder mail sent successfully to order id : ' . $order->order_id . ' at ' . now()->format('m-d-Y h:i:s')); } } } } PK !>�Z��� , Commands/SendOrderPaymentReminderCommand.phpnu �[��� <?php namespace App\Console\Commands; use App\Models\Order; use App\Models\OrderPaymentReminder; use App\Models\SiteSetting; use App\Notifications\OrderPaymentReminderNotification; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; class SendOrderPaymentReminderCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'email:send-order-payment-reminder'; /** * The console command description. * * @var string */ protected $description = 'Send email every three days to users who have not paid there order.'; public function handle(): void { $orders = OrderPaymentReminder::all(); $approve_url = config('app.react_app_payment_url'); $company_phone_1 = SiteSetting::where('key', 'Site Phone')->first(); $company_phone_2 = SiteSetting::where('key', 'Site Phone 2')->first(); $contact_email = SiteSetting::where('key', 'Notification Email')->first(); $location = SiteSetting::where('key', 'Location')->first(); foreach ($orders as $key => $order) { $db_order = Order::find($order->order_id); $pj_invoice = generatePJInvoice($db_order); if ($order->payment_status !== "Paid") { $data = [ 'user' => $order->user, 'order_number' => $order->order_number, 'amount' => $order->grand_total, 'payment_url' => $approve_url . $order->order_id, 'invoice_url' => $pj_invoice->hostedInvoiceUrl ?? null, 'order_total' => "$" . $order->grand_total, 'company_phone_1' => $company_phone_1->value ?? "N/A", 'company_phone_2' => $company_phone_2->value ?? "N/A", 'contact_email' => $contact_email->value ?? "N/A", 'location' => $location->value ?? "N/A", 'invoice_path' => $db_order->invoice->invoicePath ?? '', ]; Log::channel('info_errors')->info("Payment Reminder Email. Invoice path for order id $order->id is " . ($db_order->invoice->invoicePath ?? '')); $order->user->notify((new OrderPaymentReminderNotification($data))->delay(now()->addSeconds($key))); Log::channel('cron_jobs') ->info('Order payment reminder mail sent successfully to order id : ' . $order->order_id . ' at ' . now()->format('m-d-Y h:i:s')); } } } } PK !>�ZE�W� � $ Commands/AddOrderItemIdToPOItems.phpnu �[��� <?php namespace App\Console\Commands; use App\Models\OrderItems; use App\Models\PurchaseOrderToCreate; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; class AddOrderItemIdToPOItems extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'email:add-item-ids-to-po-orders'; /** * The console command description. * * @var string */ protected $description = 'Add order item id to items that are not created yet.'; public function handle(): void { $order_items = OrderItems::where('po_created', 0)->get(); foreach ($order_items as $item) { $po_items = PurchaseOrderToCreate::where([ 'order_id' => $item->order_id, 'product_id' => $item->product_id, 'price_id' => $item->price_id, 'quantity' => $item->quantity, ])->get(); foreach ($po_items as $po_item) { $po_item->order_item_id = $item->id; $po_item->save(); } } Log::channel('info_errors') ->info("Record ids updated for PO To Create."); } } PK !>�Z�0�1 1 $ Commands/SendPDOrdersMailCommand.phpnu �[��� <?php namespace App\Console\Commands; use App\Mail\PDOrdersMail; use App\Models\Order; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; class SendPDOrdersMailCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'email:send-po-orders-reminder'; /** * The console command description. * * @var string */ protected $description = 'Send email every day to admin.'; public function handle(): void { $old_date = now()->subDays(2)->startOfDay(); $orders = Order::where('created_at', '<=', $old_date)->where('current_status_id', 1)->get(); foreach ($orders as $key => $order) { Mail::to('orders@jmtrophies.com') ->later(now()->addSeconds($key), new PDOrdersMail(['data' => $order->order_number])); } Log::channel('cron_jobs') ->info('PD order cron mail sent at ' . now()->format('m-d-Y h:i:s')); } } PK !>�Z�.�= = Kernel.phpnu �[��� PK !>�Z]�_!� � , w Commands/SendOrderArtworkReminderCommand.phpnu �[��� PK !>�Z��� , � Commands/SendOrderPaymentReminderCommand.phpnu �[��� PK !>�ZE�W� � $ Commands/AddOrderItemIdToPOItems.phpnu �[��� PK !>�Z�0�1 1 $ 6 Commands/SendPDOrdersMailCommand.phpnu �[��� PK � �
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка