44use Illuminate \Support \Facades \Auth ;
55use App \Blog \IO \Http \Controllers \PostController ;
66use App \Blog \IO \Http \Controllers \CategoryController ;
7+ use App \Blog \IO \Http \Controllers \BlogController ;
78
8- /*
9- |--------------------------------------------------------------------------
10- | Web Routes
11- |--------------------------------------------------------------------------
12- |
13- | Here is where you can register web routes for your application. These
14- | routes are loaded by the RouteServiceProvider and all of them will
15- | be assigned to the "web" middleware group. Make something great!
16- |
17- */
18-
19- Route::get ('/health ' , function () {
20- return response ()->json (['status ' => 'ok ' , 'timestamp ' => now ()]);
21- });
22-
23- Route::get ('/ ' , function () {
24- return response ()->json ([
25- 'message ' => 'Laravel Blog Application is running! ' ,
26- 'status ' => 'success ' ,
27- 'timestamp ' => now (),
28- 'environment ' => config ('app.env ' ),
29- 'debug ' => config ('app.debug ' )
30- ]);
31- })->name ('home ' );
32-
33- // Simple blog routes without complex controllers for now
34- Route::get ('/blog ' , function () {
35- return response ()->json ([
36- 'message ' => 'Blog section - Coming soon! ' ,
37- 'status ' => 'success ' ,
38- 'timestamp ' => now ()
39- ]);
40- })->name ('blog.index ' );
9+ Route::get ('/ ' , [BlogController::class, 'index ' ])->name ('blog.index ' );
10+ Route::get ('/blog ' , [BlogController::class, 'index ' ])->name ('blog.home ' );
11+ Route::get ('/blog/{slug} ' , [BlogController::class, 'show ' ])->name ('blog.show ' );
4112
4213Auth::routes ();
4314
44- // Admin routes (protected by auth middleware)
4515Route::middleware ('auth ' )->prefix ('admin ' )->name ('admin. ' )->group (function () {
4616 Route::get ('/dashboard ' , function () {
4717 return response ()->json ([
5121 ]);
5222 })->name ('dashboard ' );
5323
54- // Post management
5524 Route::resource ('posts ' , PostController::class);
56-
57- // Category management
5825 Route::resource ('categories ' , CategoryController::class)->except (['show ' ]);
5926});
6027
61- Route::get ('/home ' , [App \Http \Controllers \HomeController::class, 'index ' ])->name ('home.controller ' );
28+ Route::get ('/home ' , [App \Http \Controllers \HomeController::class, 'index ' ])->name ('home ' );
29+
30+ Route::get ('/health ' , function () {
31+ return response ()->json (['status ' => 'ok ' , 'timestamp ' => now ()]);
32+ });
0 commit comments