app/Http/Controllers/Api/CategoryController.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()
  {
    $categories = Category::OrderBy('name', 'asc')->get();
    return response()->json($categories);
  }
public function index ( ) { $ categories = Category :: OrderBy ( 'name' , 'asc' ) -> get ( ) ; return response ( ) -> json ( $ categories ) ; }
Display a listing of the resource.
Display a listing of the resource .