[Vuejs]-Axios gives undefined while accessing data at Vue's componenet in Laravel

0👍

You have an linebreak between ' and banners, which is shown in the console line 2 "↩ banners":

Problem

public function getBanners(Request $request){
    return response()->json(['    // <-- ↩ line break
        banners'=> BannerImage::active()->get()
    ]);
}

Correct

public function getBanners(Request $request) {
    return response()->json([
        'banners' => BannerImage::active()->get()
    ]);
}

Leave a comment