app/Console/Commands/MailNotification.php
/**
     * Execute the console command.
     *
     * @return int
     */
Execute the console command.
@return int
Execute the console command . @return int
public function handle()
    {
        $users = User::all();
         $emails = [];
         foreach ($users as $key => $user) {
           array_push($emails, $user->email);
         }
        $assets = Asset::all();
         Mail::to($emails)->send(new DangerLevelMail($assets));
    }
public function handle ( ) { $ users = User :: all ( ) ; $ emails = [ ] ; foreach ( $ users as $ key => $ user ) { array_push ( $ emails , $ user -> email ) ; } $ assets = Asset :: all ( ) ; Mail :: to ( $ emails ) -> send ( new DangerLevelMail ( $ assets ) ) ; }
Execute the console command.
Execute the console command .