app/Http/Controllers/API/ProgramController.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()
    {
        $reviews = Program::all()->toArray();
        $reviews = Program::with('course')->get();
        return $reviews;
    }
public function index ( ) { $ reviews = Program :: all ( ) -> toArray ( ) ; $ reviews = Program :: with ( 'course' ) -> get ( ) ; return $ reviews ; }
Display a listing of the resource.
Display a listing of the resource .
// $reviews = Program::all()->toArray(); // return array_reverse($reviews);