app/Console/Commands/Send.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle(LogChart $logCharts, ParserStrategy $parserStratagy)
    {
        $file = $this->option("f");
        $type = $this->option("t");
        $email = $this->option("m");
        $parser = $parserStratagy->getParser($type);
        $logs = $parser->parse($file);
        $fields = $parser->getStatsFields();
        $charts=[];
        foreach ($fields as $field) {
            $charts[$field] = $logCharts->getChart($logs[$field]);
        }
        Mail::send('emails.summary_'.$type, [
            'logs' => $logs,
            'chart' => $charts
        ], function ($m) use($email) {
            $m->from('news@loginfo.com', 'Loginfo');
            $m->to($email, "Subscriber")->subject("Logs Information");
        });
    }
public function handle ( LogChart $ logCharts , ParserStrategy $ parserStratagy ) { $ file = $ this -> option ( " f " ) ; $ type = $ this -> option ( " t " ) ; $ email = $ this -> option ( " m " ) ; $ parser = $ parserStratagy -> getParser ( $ type ) ; $ logs = $ parser -> parse ( $ file ) ; $ fields = $ parser -> getStatsFields ( ) ; $ charts = [ ] ; foreach ( $ fields as $ field ) { $ charts [ $ field ] = $ logCharts -> getChart ( $ logs [ $ field ] ) ; } Mail :: send ( 'emails.summary_' . $ type , [ 'logs' => $ logs , 'chart' => $ charts ] , function ( $ m ) use ( $ email ) { $ m -> from ( 'news@loginfo.com' , 'Loginfo' ) ; $ m -> to ( $ email , " Subscriber " ) -> subject ( " Logs Information " ) ; } ) ; }
Execute the console command.
Execute the console command .