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