app/Http/Controllers/BookController.php
/**
     * Retrieves an array of given categories, even if it's a comma separated string
     * (user input could be anything)
     *
     * @param array|string $request
     * @return array
     */
Retrieves an array of given categories, even if it's a comma separated string
(user input could be anything)

@param array|string $request
@return array
Retrieves an array of given categories even if it ' s a comma separated string ( user input could be anything ) @param array|string $request @return array
protected function resolveCategories($request)
    {
        if (!is_array($request->categories)) {
            $categories = explode(',', $request->categories);
        } else {
            $categories = $request->categories;
        }
        return $categories;
    }
protected function resolveCategories ( $ request ) { if ( ! is_array ( $ request -> categories ) ) { $ categories = explode ( ',' , $ request -> categories ) ; } else { $ categories = $ request -> categories ; } return $ categories ; }
Retrieves an array of given categories, even if it's a comma separated string
 (user input could be anything)
Retrieves an array of given categories even if it ' s a comma separated string ( user input could be anything )