app/Http/Controllers/HomePageController.php
private function checkDefaultTreeBlocksExist(): void
    {
        $has_blocks = DB::table('block')
            ->where('gedcom_id', '=', -1)
            ->exists();

        // No default settings?  Create them.
        if (!$has_blocks) {
            foreach (['main', 'side'] as $location) {
                foreach (self::DEFAULT_TREE_PAGE_BLOCKS[$location] as $block_order => $class) {
                    $module_name = $this->module_service->findByInterface($class)->first()->name();

                    DB::table('block')->insert([
                        'gedcom_id'   => -1,
                        'location'    => $location,
                        'block_order' => $block_order,
                        'module_name' => $module_name,
                    ]);
                }
            }
        }
    }
private function checkDefaultTreeBlocksExist(): void
    {
        $has_blocks = DB::table('block')
            ->where('gedcom_id', '=', -1)
            ->exists();

        // No default settings?  Create them.
        if (!$has_blocks) {
            foreach (['main', 'side'] as $location) {
                foreach (self::DEFAULT_TREE_PAGE_BLOCKS[$location] as $block_order => $class) {
                    $module_name = $this->module_service->findByInterface($class)->first()->name();

                    DB::table('block')->insert([
                        'gedcom_id'   => -1,
                        'location'    => $location,
                        'block_order' => $block_order,
                        'module_name' => $module_name,
                    ]);
                }
            }
        }
    }
private function checkDefaultTreeBlocksExist ( ) : void { $ has_blocks = DB :: table ( 'block' ) -> where ( 'gedcom_id' , '=' , - 1 ) -> exists ( ) ; // No default settings?  Create them. if ( ! $ has_blocks ) { foreach ( [ 'main' , 'side' ] as $ location ) { foreach ( self :: DEFAULT_TREE_PAGE_BLOCKS [ $ location ] as $ block_order => $ class ) { $ module_name = $ this -> module_service -> findByInterface ( $ class ) -> first ( ) -> name ( ) ; DB :: table ( 'block' ) -> insert ( [ 'gedcom_id' => - 1 , 'location' => $ location , 'block_order' => $ block_order , 'module_name' => $ module_name , ] ) ; } } } }
Make sure that default blocks exist for a tree.

@return void
Make sure that default blocks exist for a tree .