The index shows all entries in a table while the show only shows one specific entry.
index vs show
Check this ref: https://laravel.com/docs/6.x/controllers#restful-naming-resource-routes
What is the difference between action index and action show? Is both showing the same tables?
Let's say you have a table of books.
On the index page you show information like
- Title
- Author
- Series
- Format
- Publication year
Then if you click on one of the books in the list you get more informtion about the book, like
- Isbn
- Blurb
- Number of pages
- List of reviews
- and so on
The same would go for a record collection.
Or as here on Laracasts Forum
You have an index showing all the threads and a show showing the full question and all the answers to it.
You should use it when you want to display more information about a record in the database.
The index is most likely a table yes. The show is usually not a table and it's not a form either. Forms are reserved for create and update views.
Please or to participate in this conversation.