Now let's work on editing the post. This is going to be kind of a repeating thing, similar to what we did with the create form but with minor changes.

Edit Page Route
So first, let's add a link to the Edit page in the posts list.
resources/js/components/Posts/Index.vue:
<template> <div class="overflow-hidden overflow-x-auto p-6 bg-white border-gray-200"> <div class="min-w-full align-middle"> // ... <table class="min-w-full divide-y divide-gray-200 border"> <thead> <tr> // ... <th class="px-6 py-3 bg-gray-50 text-left"> <div class="flex flex-row items-center justify-between cursor-pointer" @click="updateOrdering('created_at')"> <div class="leading-4 font-medium text-gray-500 uppercase tracking-wider" :class="{ 'font-bold text-blue-600': orderColumn === 'created_at' }"> Created at </div> <div class="select-none"> <span :class="{ 'text-blue-600': orderDirection === 'asc' && orderColumn === 'created_at', 'hidden': orderDirection !== '' && orderDirection !== 'asc' && orderColumn === 'created_at', }">↑</span> <span :class="{ 'text-blue-600': orderDirection === 'desc' && orderColumn === 'created_at', 'hidden': orderDirection !== '' && orderDirection !== 'desc' && orderColumn === 'created_at', }">↓</span> </div> </div> </th> <th class="px-6 py-3 bg-gray-50 text-left"> <span class="text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">Actions</span> </th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200 divide-solid"> <tr v-for="post in posts.data"> // ... <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-900"> {{ post.created_at }} </td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-900"> <router-link :to="{ name: 'posts.edit', params: { id: post.id } }">Edit</router-link> </td> </tr> </tbody> </table> <TailwindPagination :data="posts" @pagination-change-page="page => getPosts(page, selectedCategory)" class="mt-4" /> </div> </div></template> <script setup>// ...

Now, for the edit link, we added a parameter id. Next, we need to add a route with this parameter. The syntax for adding a parameter is...
"There's one image that is not available, only the text 'empty edit form' is written. Is it important or not?"
It wasn't important screenshot. Fixed the link.
In the edit form, the modified content field from the PostResource is shown. Is there a way to display the full content in the edit form but still keep the truncated content in the post index view? Could you create a PostEditResource and return the full values of the Post? It seems clicking save updates the content field to be exactly that truncated value.
You can just add another value to the
@Nerijus your reply seems truncated as well... I'd like to know how to update the full value of content shown in the Edit.vue
Tell more what you want
As Remy Jay mentioned, how to keep full value of content without limiting the words.
Add whatever values you want to a api resource and name it whatever you
Why I can't update post and error (Edit.vue): updatePost is not an function?
Because you have to add the function in Edit.vue: const { post, getPost, updatePost, validationErrors, isLoading } = usePosts()
how to update a file using put? axios.put('/api/posts', post) - PostController $request = It works, but file is empty
let serializedPost = new FormData() for (let item in post) { if (post.hasOwnProperty(item)) {serializedPost.append(item, post[item])}} ... axios.put('/api/posts', serializedPost) - PostController $request->all() = empty array
I was getting, "Uncaught TypeError: ctx.updatePost is not a function at Edit.vue:2:28" in Dev Console. In resources/js/components/Posts/Edit.vue, shouldn't
const { post, getPost, validationErrors, isLoading } = usePosts() be instead const { post, getPost, updatePost, validationErrors, isLoading } = usePosts() ? I added updatePost and it now works fine.