/
home
/
maktab
/
server
/
app
/
Console
/
Commands
/
File Upload :
llllll
Current File: /home/maktab/server/app/Console/Commands/BirthdayCommand.php
<?php namespace App\Console\Commands; use App\Models\Sms; use App\Models\Student; use App\Models\User; use Illuminate\Console\Command; use Morilog\Jalali\Facades\jDate; class BirthdayCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'birth_day:sms'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return int */ public function handle() { $customers = Student::whereDay('birth_day',now()->addDays(3)->format('d')) ->whereMonth('birth_day',now()->addDays(3)->format('m')) ->get(); foreach ($customers as $cu){ $teacher = User::findOrFail($cu->employee_id); // Sms::Send('09136982135' , 'مکتب|یادآوری'."\n". // 'تولد آقای '.$cu->name.' در تاریخ '.verta()->addDays(3)->format('Y/n/j')."\n" // ); Sms::Send($teacher->mobile , 'مکتب|یادآوری'."\n". 'تولد آقای '.$cu->name.' در تاریخ '.verta()->addDays(3)->format('Y/n/j')."\n" ); } } }
Copyright ©2k19 -
Hexid
|
Tex7ure