After much thought, I'm considering transitioning my app entirely to Vue frontend. However, there are some concerns on my mind, such as:
Currently, in Laravel blade (posts page), I have the following structure:
@foreach($posts as $post)
<post data="{!! json_encode($post) !!}">
@if(auth()->user()->id === $post->user->id)
<edit-post></edit-post>
@endif
</post>
@endforeach
If I were to convert this to Vue entirely, I would need to:
-In master.blade.php where I use Vue, I would need to pass:
window.userData = {id: '{{auth()->user()->id}}'};
Then, I would need to check it within Vue. However, what if a client-side user changes that global object ID to the post user's ID? They could potentially access the edit component, even though it wouldn't affect the backend due to user validation. Is there a way to prevent this?