- Refactored the ChampionController, ChampionSkinController, HomeController, SaleController, SummonerEmoteController, and SummonerIconController to use arrow functions for cache callbacks.
- Updated the view data passing in the ChampionController, ChampionSkinController, HomeController, PostsController, SaleController, SummonerEmoteController, and SummonerIconController to use associative arrays instead of compact().
- Removed unused imports from web.php.
This commit adds pagination functionality to the posts index page. The code changes include:
- Sorting the posts by descending date
- Paginating the posts with 6 items per page
- Creating a new component called "Listposts" for rendering the paginated posts
- Adding a new view file for the "Listposts" component
- Updating the blade template of the posts index page to use the "Listposts" component and pass in the paginated posts
The purpose of these changes is to improve user experience by displaying a limited number of posts per page and providing navigation links for easier browsing.
- Added a new file `PostsController.php` in the `app/Http/Controllers` directory.
- Implemented the `index()` method to retrieve all posts using the Sheets facade.
- Implemented the `show()` method to display a single post using route model binding with Sheets.
- Updated the `RouteServiceProvider.php` file to bind the 'post' route parameter to retrieve posts from the Sheets collection.
- Created a new configuration file `sheets.php` in the `config` directory, defining default settings for collections and their corresponding sheet classes, path parsers, content parsers, and extensions.
- Added a new markdown file `hello-world.md` in the `content/posts` directory as an example post.
- Created two new blade view files: `index.blade.php` and `show.blade.php`, under the `resources/views/posts` directory, for displaying lists of posts and individual post details respectively.
- Modified the existing web routes (`web.php`) to include routes for accessing posts.
The changes enable users to view all posts on `/posts`, as well as access individual post details at `/post/{post}`.