The simple answer is: "Don't send it to the front end".
Think about it. You want to send it to Vue but you don't want to show it in the source code? Once its on the page it is in the source code.
Maybe you are sending too much data to front end?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi good people, I am using Laravel and Vue.js to create a project.
You can see that I am getting categories from Laravel and injecting the data to Vue.js component.
My blade file @extends('layouts.app')
@section('content') <!-- some more code here to process categories--!> @endsection
Generated html when i view page source
<!-- header stuff -->
<main class="py-4">
<index-vue inline-template :categories="[{"id":1,"name":"Clothes","slug":"clothes","created_at":"2020-07-17T08:02:04.000000Z","updated_at":"2020-07-17T08:02:04.000000Z","category_count":660},{"id":2,"name":"Shoes","slug":"shoes","created_at":"2020-07-17T08:02:04.000000Z","updated_at":"2020-07-17T08:02:04.000000Z","category_count":660},{"id":3,"name":"Fashion","slug":"fashion","created_at":"2020-07-17T08:02:04.000000Z","updated_at":"2020-07-17T08:02:04.000000Z","category_count":660},{"id":4,"name":"Rings","slug":"rings","created_at":"2020-07-17T08:02:04.000000Z","updated_at":"2020-07-17T08:02:04.000000Z","category_count":660},{"id":5,"name":"Shoes","slug":"shoes","created_at":"2020-07-17T08:02:04.000000Z","updated_at":"2020-07-17T08:02:04.000000Z","category_count":660}]">
<div class="container">
<!-- container stuff -->
</div>
</index-vue>
</main>
</div>
My question is how can i hide or encrypt the data that i have injected in such a way that it can not be viewed if someone viewed page source on the browser? Please don't provide an ajax or axios call back solution since i am comfortable with how that works.
Please or to participate in this conversation.