app/Console/Commands/TotalPay.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle()
    {
        $sm = "";
        $sell = DB::table('sells')->orderBy('created_at', 'desc');
        $sm = $sell->sum('paid');
        $sell = new Sell();
        $sell = DB::table('sells')->update(['result' => $sm]);
        return $this->info('Achieved');
    }
public function handle ( ) { $ sm = " " ; $ sell = DB :: table ( 'sells' ) -> orderBy ( 'created_at' , 'desc' ) ; $ sm = $ sell -> sum ( 'paid' ) ; $ sell = new Sell ( ) ; $ sell = DB :: table ( 'sells' ) -> update ( [ 'result' => $ sm ] ) ; return $ this -> info ( 'Achieved' ) ; }
Execute the console command.
Execute the console command .
// $sell->update(['result' => $sm]); /*foreach ($sell as $se){

            $sm = $se->sum('paid');
            return $this->info('Achieved');
        }*/