app/Http/Controllers/API/CourseController.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()
    { 
        $courses = Course::all()->toArray();
        return response()->json($courses);
    }
public function index ( ) { $ courses = Course :: all ( ) -> toArray ( ) ; return response ( ) -> json ( $ courses ) ; }
Display a listing of the resource.
Display a listing of the resource .