app/Http/Controllers/PersonaController.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 listarPorDireccion()
    {
        $user = Auth::user();
        $area_id=$user->area_id;
         $personas=Persona::with('dependencia')->where('area_id',$area_id)->get();
        return response()->json($personas->toArray());
    }
public function listarPorDireccion ( ) { $ user = Auth :: user ( ) ; $ area_id = $ user -> area_id ; $ personas = Persona :: with ( 'dependencia' ) -> where ( 'area_id' , $ area_id ) -> get ( ) ; return response ( ) -> json ( $ personas -> toArray ( ) ) ; }
Display a listing of the resource.
Display a listing of the resource .