murilo
259
3
Laravel

Searching , and change the result / json decode .

Posted 8 months ago by murilo

I dont know if this is possible , I am getting a Json decode search and using this VUE js . like this -

  $post = Post::select(['id', 'status' , 'title'  , 'description'])->get();

   return response()->json([ $post ]);

I wold like to change my search , using -


str_limit('description', 40) in the description field

something like that -


  $post = Post::select(['id', 'status' , 'title'  , str_limit('description', 40) ])->get();

   return response()->json([ $post ]);


Thanks

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