app/Http/Controllers/Api/AlunosController.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()
  {
    $alunos = Aluno::with('Curso')->get();
    return response()->json(['alunos' => $alunos]);
  }
public function index ( ) { $ alunos = Aluno :: with ( 'Curso' ) -> get ( ) ; return response ( ) -> json ( [ 'alunos' => $ alunos ] ) ; }
Display a listing of the resource.
Display a listing of the resource .