app/Http/Controllers/FuncionarioController.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()
    {
        $funcionarios = Funcionario::with('usuario')->get();
        return json_encode($funcionarios);
    }
public function index ( ) { $ funcionarios = Funcionario :: with ( 'usuario' ) -> get ( ) ; return json_encode ( $ funcionarios ) ; }
Display a listing of the resource.
Display a listing of the resource .