app/Http/Controllers/Seller/SellerCategoryController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(User $seller)
    {
        $categories = $seller->products()
            ->with('categories')
            ->get()
            ->pluck('categories')
            ->collapse()
            ->unique('id')
            ->values();
        return $this->showAll(new CategoryCollection($categories));
    }
public function index ( User $ seller ) { $ categories = $ seller -> products ( ) -> with ( 'categories' ) -> get ( ) -> pluck ( 'categories' ) -> collapse ( ) -> unique ( 'id' ) -> values ( ) ; return $ this -> showAll ( new CategoryCollection ( $ categories ) ) ; }
Display a listing of the resource.
Display a listing of the resource .