Add blog feature and fix broken test/build infra
BlogController was an empty stub with no view, so /blog 500'd on every visit. Adds a real Post model, public listing/detail pages, and an admin CRUD screen mirroring the existing Exercise admin pattern (image upload or URL, auto-slug, publish toggle). Seeds 5 real posts so it's not empty on launch. Also fixes two things that were silently broken: phpunit.xml pointed DB_DATABASE at a non-existent "testing" file with no DB_CONNECTION set, and the stock ExampleTest had RefreshDatabase commented out - both meant the test suite never actually ran successfully. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,8 @@ Route::prefix('admin')->middleware(['auth','admin'])->group(function(){
|
||||
Route::get('/', [\App\Http\Controllers\AdminDashboardController::class, 'index'])->name('admin.dashboard');
|
||||
// Admin Exercises CRUD
|
||||
Route::resource('exercises', \App\Http\Controllers\Admin\ExerciseController::class)->except(['show'])->names('admin.exercises');
|
||||
// Admin Posts CRUD
|
||||
Route::resource('posts', \App\Http\Controllers\Admin\PostController::class)->except(['show'])->names('admin.posts');
|
||||
});
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
@@ -60,6 +62,7 @@ Route::middleware('auth')->group(function () {
|
||||
|
||||
Route::prefix('/blog')->group(function () {
|
||||
Route::get('/', [\App\Http\Controllers\BlogController::class, 'index'])->name('blog.index');
|
||||
Route::get('/{post:slug}', [\App\Http\Controllers\BlogController::class, 'show'])->name('blog.show');
|
||||
});
|
||||
|
||||
// Yoga poses
|
||||
|
||||
Reference in New Issue
Block a user