TesterMesster
TesterMesster

Reputation: 1

How to Edit JSON data displaying what i want

Click for image

Here I am displaying my JSON. What is the best way for me to go through the data and display ID and Seat_name for each at the same time?

this is the output i am looking for

image

Upvotes: 0

Views: 45

Answers (1)

STA
STA

Reputation: 34708

You can use select method to select specific column data :

$availableSeat = Seat::select('id', 'seat_name')->where('status', 0)->get();

Or, you can do with on get() method as like :

$availableSeat = Seat::where('status', 0)->get(['id','seat_name']);

Upvotes: 1

Related Questions