public static function categoryParentSingleSelectCreate($categories) {

        // STEP 1: Initiatize the html select tag
        $html = "";
        $html .= '<select name="parent_id" id="parent_id" size="6" class="form-control" >';

        $html .= '<option ';
        $html .= 'value="';
        $html .= 0;
        $html .= '">';
        $html .= 'No Parent Category';
        $html .= '</option>"';

        // STEP 2: Construct the <option></option> categories for ALL categories in the categories table
        foreach ($categories as $category) {
            $html .= '<option ';
            $html .= 'value="';
            $html .= $category->id;
            $html .= '">';
            $html .= $category->title;
            $html .= '</option>"';
        }
        $html .= '</select>';

        $html .= self::renderBootstrapMultiselectPlugin(count($categories));

        return $html;
    }
public static function categoryParentSingleSelectCreate($categories) {

        // STEP 1: Initiatize the html select tag
        $html = "";
        $html .= '<select name="parent_id" id="parent_id" size="6" class="form-control" >';

        $html .= '<option ';
        $html .= 'value="';
        $html .= 0;
        $html .= '">';
        $html .= 'No Parent Category';
        $html .= '</option>"';

        // STEP 2: Construct the <option></option> categories for ALL categories in the categories table
        foreach ($categories as $category) {
            $html .= '<option ';
            $html .= 'value="';
            $html .= $category->id;
            $html .= '">';
            $html .= $category->title;
            $html .= '</option>"';
        }
        $html .= '</select>';

        $html .= self::renderBootstrapMultiselectPlugin(count($categories));

        return $html;
    }
public static function categoryParentSingleSelectCreate ( $ categories ) { // STEP 1: Initiatize the html select tag $ html = "" ; $ html .= '<select name="parent_id" id="parent_id" size="6" class="form-control" >' ; $ html .= '<option ' ; $ html .= 'value="' ; $ html .= 0 ; $ html .= '">' ; $ html .= 'No Parent Category' ; $ html .= '</option>"' ; // STEP 2: Construct the <option></option> categories for ALL categories in the categories table foreach ( $ categories as $ category ) { $ html .= '<option ' ; $ html .= 'value="' ; $ html .= $ category -> id ; $ html .= '">' ; $ html .= $ category -> title ; $ html .= '</option>"' ; } $ html .= '</select>' ; $ html .= self :: renderBootstrapMultiselectPlugin ( count ( $ categories ) ) ; return $ html ; }
Create a dropdown with a single select for the parent category

@param  collection  $categories  Laravel collection object of category
@return string
Create a dropdown with a single select for the parent category