app/Http/Controllers/HomePageController.php
private function userBlocks(int $user_id, string $location): Collection
    {
        $rows = DB::table('block')
            ->where('user_id', '=', $user_id)
            ->where('location', '=', $location)
            ->orderBy('block_order')
            ->pluck('module_name', 'block_id');

        return $this->filterActiveBlocks($rows, $this->availableUserBlocks());
    }
private function userBlocks(int $user_id, string $location): Collection
    {
        $rows = DB::table('block')
            ->where('user_id', '=', $user_id)
            ->where('location', '=', $location)
            ->orderBy('block_order')
            ->pluck('module_name', 'block_id');

        return $this->filterActiveBlocks($rows, $this->availableUserBlocks());
    }
private function userBlocks ( int $ user_id , string $ location ) : Collection { $ rows = DB :: table ( 'block' ) -> where ( 'user_id' , '=' , $ user_id ) -> where ( 'location' , '=' , $ location ) -> orderBy ( 'block_order' ) -> pluck ( 'module_name' , 'block_id' ) ; return $ this -> filterActiveBlocks ( $ rows , $ this -> availableUserBlocks ( ) ) ; }
Get the blocks for a specified user.

@param int    $user_id
@param string $location "main" or "side"

@return Collection
@return ModuleBlockInterface[]
Get the blocks for a specified user .