CasperSecurity

Current Path : /var/www/orientalss.com/app/Console/Commands/
Upload File :
Current File : /var/www/orientalss.com/app/Console/Commands/ReminderTenderActivityBeforeStartDate.php

<?php

namespace App\Console\Commands;

use App\Models\CreateTender;
use App\Models\User;
use App\Notifications\ReminderBeforeActivityStartDate;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Notification;

class ReminderTenderActivityBeforeStartDate extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'oss:tender-reminder';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Reminder For Tender Activity Before Start Date';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $tenders=CreateTender::whereDate('tender_closing_date','>=',date('Y-m-d'))
            ->where('tender_status','>','4')
            ->where('tender_status','<','6')->get();
            foreach ($tenders as $tender){
                $tender->getClient;
                $employees=explode(',',$tender['tender_assigned_to']);
                $tender->assignTo=$employees;
                foreach ($tender->tenderYetToStartActivites as $activity){
                    $actvityemployees=explode(',',$activity['activity_assigned_to']);
                    $activity->assignTo=$actvityemployees;
                    foreach ($actvityemployees as $userid){
                        if($activity['activity_start_date']== Carbon::now()->addDay('1')->format('Y-m-d')){
                            $sendtouser=User::find($userid);
                            Notification::sendNow($sendtouser,new ReminderBeforeActivityStartDate($activity,$sendtouser));
                        }
                    }

                }
            }
         return true;
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY