Skip to content

Commit

Permalink
Blog Route Improved
Browse files Browse the repository at this point in the history
Blog Route Improved
  • Loading branch information
codephics committed Aug 15, 2024
1 parent 2fbd24c commit 3a3287f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Global/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public function shop()
]);
}

public function blogs()
public function blog()
{
$page = Page::where('slug', 'more-blogs')->firstOrFail();
$page = Page::where('slug', 'blog')->firstOrFail();
$setting = Setting::first();
$blogs = Blog::all();

Expand Down
6 changes: 3 additions & 3 deletions database/migrations/2023_12_12_060508_create_pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public function up(): void
'slug' => 'contact-us',
],
[
'name' => 'More Blogs',
'title' => 'More Blogs',
'slug' => 'more-blogs',
'name' => 'Blog',
'title' => 'Blog',
'slug' => 'blog',
],
]);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backend/global/page/edit-page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<div class="col-sm-6">
<div class="mb-3">
<label for="slug" class="form-label">Slug</label>
<input type="text" class="form-control" name="slug" value="{{ $page->slug }}" placeholder="Slug" readonly />
<input type="text" class="form-control" name="slug" value="{{ $page->slug }}" placeholder="Slug" />
</div>
</div>
<div class="col-sm-6">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/frontend/blog/more.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ route('front.home') }}">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">More Blogs</li>
<li class="breadcrumb-item active" aria-current="page">Blog</li>
</ol>
</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
|--------------------------------------------------------------------------
*/

Route::get('blog', [PageController::class, 'blogs'])->name('blog.more');
Route::get('blog', [PageController::class, 'blog'])->name('blog.more');
Route::get('blog/{slug}', [PageController::class, 'detail'])->name('blog.detail');

/*
Expand Down

0 comments on commit 3a3287f

Please sign in to comment.