src/Block.php
public function selectCategories()
    {
        $temp = [];
        $category = $this->category->scopeQuery(function ($query) {
            return $query->whereStatus('Show')->orderBy('name', 'ASC');
        })->all();

        foreach ($category as $key => $value) {
            $temp[$value->id] = ucfirst($value->name);
        }

        return $temp;
    }
public function selectCategories()
    {
        $temp = [];
        $category = $this->category->scopeQuery(function ($query) {
            return $query->whereStatus('Show')->orderBy('name', 'ASC');
        })->all();

        foreach ($category as $key => $value) {
            $temp[$value->id] = ucfirst($value->name);
        }

        return $temp;
    }
public function selectCategories ( ) { $ temp = [ ] ; $ category = $ this -> category -> scopeQuery ( function ( $ query ) { return $ query -> whereStatus ( 'Show' ) -> orderBy ( 'name' , 'ASC' ) ; } ) -> all ( ) ; foreach ( $ category as $ key => $ value ) { $ temp [ $ value -> id ] = ucfirst ( $ value -> name ) ; } return $ temp ; }
take block category
@return array
take block category