mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
- 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}`.
95 lines
2.5 KiB
PHP
95 lines
2.5 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\AboutController;
|
|
use App\Http\Controllers\AssetsController;
|
|
use App\Http\Controllers\ChampionController;
|
|
use App\Http\Controllers\FAQController;
|
|
use App\Http\Controllers\PostsController;
|
|
use App\Http\Controllers\SaleController;
|
|
use App\Http\Controllers\SummonerEmoteController;
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\HomeController;
|
|
use App\Http\Controllers\ChampionSkinController;
|
|
use App\Http\Controllers\SummonerIconController;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "web" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', [HomeController::class, 'index']);
|
|
|
|
// Champions
|
|
Route::get('/champions', [ChampionController::class, 'index'])->name('champions.index');
|
|
Route::get('/champion/{champion}', [ChampionController::class, 'show'])->name('champions.show');
|
|
// Skins
|
|
Route::get('/skins', [ChampionSkinController::class, 'index'])->name('skins.index');
|
|
Route::get(
|
|
'/skin/{championSkin}',
|
|
[ChampionSkinController::class, 'show']
|
|
)->name('skins.show');
|
|
|
|
// Icons
|
|
Route::get('/icons', [
|
|
SummonerIconController::class,
|
|
'index'
|
|
])->name('assets.icons.index');
|
|
Route::get('/icon/{summonerIcon}', [
|
|
SummonerIconController::class,
|
|
'show'
|
|
])->name('assets.icons.show');
|
|
|
|
// Emotes
|
|
Route::get('/emotes', [
|
|
SummonerEmoteController::class,
|
|
'index'
|
|
])->name('assets.emotes.index');
|
|
|
|
// Assets
|
|
Route::get('/assets', [
|
|
AssetsController::class,
|
|
'index'
|
|
])->name('assets.index');
|
|
|
|
// Sales
|
|
Route::get('/sale-rotation', [SaleController::class, 'index'])->name('sales.index');
|
|
|
|
// About
|
|
Route::get('/about', [
|
|
AboutController::class,
|
|
'index'
|
|
])->name('about.index');
|
|
|
|
// About.FAQController
|
|
Route::get('/about/faq/league-of-legends', [
|
|
FAQController::class,
|
|
'leagueoflegends'
|
|
])->name('about.faq.leagueoflegends');
|
|
|
|
Route::get('/about/faq/heimerdinger', [
|
|
FAQController::class,
|
|
'heimerdinger'
|
|
])->name('about.faq.heimerdinger');
|
|
|
|
// Posts
|
|
Route::get('/posts', [
|
|
PostsController::class,
|
|
'index'
|
|
])->name('posts.index');
|
|
|
|
Route::get('/post/{post}', [
|
|
PostsController::class,
|
|
'show'
|
|
])->name('posts.show');
|
|
|
|
// Pulse
|
|
Route::get(config('app.login_route'), function () {
|
|
return redirect('/pulse');
|
|
})->name('login')->middleware('auth.basic');
|