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);