/
home
/
maktab
/
server
/
app
/
Console
/
Commands
/
File Upload :
llllll
Current File: /home/maktab/server/app/Console/Commands/BirthdayTeacherCommand.php
<?php namespace App\Console\Commands; use App\Models\Sms; use App\Models\User; use Illuminate\Console\Command; class BirthdayTeacherCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'teacher:birthday'; /** * 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() { $users = User::whereDay('birth_day',now()->addDays(3)->format('d')) ->whereMonth('birth_day',now()->addDays(3)->format('m')) ->where('type',4) ->get(); foreach ($users as $user){ $modir = User::where('type',3) ->where('maktab_id',$user->maktab_id) ->first(); $birthday = verta($modir->birth_day)->format('Y/n/j'); Sms::Send($modir->mobile , 'مکتب|یادآوری'."\n". 'تولد آقای '.$user->name.' در تاریخ '.$birthday."\n" ); } } }
Copyright ©2k19 -
Hexid
|
Tex7ure