Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

How to print Array data in console.log in laravel ?

In this tutorial im going to learn how to print how many data is coming in array.

1st step go to your blade page and put below code for getting the array value.

 console.log(data.data);
var apiURL = "{{ url('api/v1/j/rating/index') }}/" + id;
            $.ajax({
                url: apiURL,
                type: "GET",
                dataType: "json",
                headers: {
                    "Authorization": "Bearer " + localStorage.getItem('a_u_a_b_t')
                },
                success: function(data) {
                    console.log(data.data);
                    for (var i = 0; i < data.data.length; i++) {
                        var currentObject = data.data[i];
                        console.log("Admin ID:", currentObject.admin_id);
                        console.log("Admin Email:", currentObject.admin_email);
                        console.log("Months:", currentObject.month);
                        console.log("Name:", currentObject.rating_user_name);
                        console.log("Manager Name:", currentObject.rating_manager_name);
                        console.log("Year:", currentObject.year);
                        console.log("Rating:", currentObject.rating);
                        $('#ratings_new').html(currentObject.rating);
                        $('#taskboardviewdetails_new').modal('show');
                    }
                    // renderCards(data.data);
                    renderCards(currentObject);
                },
                error: function(error) {
                    console.log("Error fetching data:", error);
                }
            });

Now output coming successfully.

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

How to Use jQuery to Validate an Empty Input Field in laravel ?

jQuery is still a strong and popular JavaScript library for processing user input and providing interactivity to online projects. It is the best option for implementing client-side…

How to Get On click Data id using getAttribute() method ?

In this tutorial I’m going to learn how to get onclick get data id using JavaScript get id of the element that has the onclick event. javascript…

How to change image on change in jQuery ?

In this tutorial we’re going to learn how to change image on change i have to use the change() event is attached to the imageList select element…

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x