Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/azzarip/notaCMS
Browse files Browse the repository at this point in the history
  • Loading branch information
azzarip committed Jan 4, 2024
2 parents 68ca074 + 5b945dc commit 27d5338
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `notaCMS` will be documented in this file.

## Bug Fix - 2024-01-03

It redirects the user to index when slug not found.

## First Release v1.0.0 - 2024-01-03

- It can create a new blog with command `notacms:new {Blogname}`
Expand Down
3 changes: 2 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
Route::get('/{blog}/{slug}', function (string $blog, string $slug) {
$model = config('notacms.'.$blog);
$post = call_user_func([$model, 'findSlug'], $slug);
if(is_null($post)){
if (is_null($post)) {
return redirect($blog);
}

return view('notacms::'.$blog.'.show', compact('post'));
})->whereIn('blog', array_keys(config('notacms')));

0 comments on commit 27d5338

Please sign in to comment.