MySQL parent / child table not showing parent entries
The join should be on the opposite direction and without the WHERE. Think of this as starting with any category (r). All of them either have a parent (so the parent_name and parent_id will appear) or not (so those columns will have NULL):

SELECT e.name AS parent_name, 
       e.id AS parent_id, 
       r.id AS child_id, 
       r.name AS child_name
FROM categories r
     LEFT JOIN categories e
     ON e.id = r.parent 
ORDER BY COALESCE(parent_name, child_name),   -- first the parent or itself
         child_name ;                         -- then itself