Manipulate JSON before return

Posted 2 years ago by Totemusik

Hello,

I do a request for sites from DB for display with vue.js.

If I do this query I get my result

$pages = DB::table('pages')->get();

{ "id": 1, ... "requiresAuth": 1 },

That´s fine so far, but I need to put the requiresAuth into "meta", before return the data.

meta: { requiresAuth: false }

Thank you very much for any help and hints.

Regards

Torsten

Please sign in or create an account to participate in this conversation.