app/Containers/Import/UI/CLI/Commands/ImportOldDatabaseCommand.php
/**
     * Execute the console command.
     *
     * @return void
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
     */
Execute the console command.
@return void
@throws \Illuminate\Contracts\Filesystem\FileNotFoundException
Execute the console command . @return void @throws \ Illuminate \ Contracts \ Filesystem \ FileNotFoundException
public function handle()
    {
        $this->info('Importing...');
        $this->importLookupTables();
        $this->info('Importing farmer...');
        $project = Project::find(1);
        $smallholders = SmallholderO::with([
            'genderR',
            'mus',
        ])
            ->get();
        $this->output->progressStart(count($smallholders));
        foreach ($smallholders as $smallholder)
        {
            $this->importFarmer($smallholder, $project);
            $this->output->progressAdvance();
        }
        $this->output->progressFinish();
    }
public function handle ( ) { $ this -> info ( 'Importing...' ) ; $ this -> importLookupTables ( ) ; $ this -> info ( 'Importing farmer...' ) ; $ project = Project :: find ( 1 ) ; $ smallholders = SmallholderO :: with ( [ 'genderR' , 'mus' , ] ) -> get ( ) ; $ this -> output -> progressStart ( count ( $ smallholders ) ) ; foreach ( $ smallholders as $ smallholder ) { $ this -> importFarmer ( $ smallholder , $ project ) ; $ this -> output -> progressAdvance ( ) ; } $ this -> output -> progressFinish ( ) ; }
Execute the console command.
Execute the console command .
//import lookuptables //load all smallholder //take the first project for now, as there is only one