From 97b48aaf52e08bb48c574a0fc172a6c06cc58c84 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 14 Feb 2026 02:50:05 +0100 Subject: [PATCH] wip: 2026-02-14T02:50:05+0100 (1771033805) --- src/Posts/Post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Posts/Post.php b/src/Posts/Post.php index 43ffd91..f556966 100644 --- a/src/Posts/Post.php +++ b/src/Posts/Post.php @@ -23,10 +23,10 @@ * @param string $name * @return static|null */ - public static function from_name(string $name): ?static { + public static function from_name(string $name, bool $slugify = true): ?static { $query = Database::current() ->from(Database::get_table(Posts::TABLE_NAME)) - ->where([Posts::POST_NAME->value => slugify($name)]) + ->where([Posts::POST_NAME->value => $slugify ? slugify($name) : $name]) ->limit(1) ->select(Posts::ID->value);