Home > Back-end >  Remove The Object from Json
Remove The Object from Json

Time:07-18

Please I Have 'active:1' In My Json But I Want To Remove "active:" and all object and array Like This

       [
 
       {


       } 


  ]

and i want the output // 1

    [
    {
        "active": 1 // I Want This Result 1 Without active
    }
]

// Output 1

This My Code

  return  Category::where('active' , $request -> active)->get('active'); // Output 1

CodePudding user response:

Category::where('active' , $request->active)->first()?->active;
  • Related