Update (view): redesign
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
if (! function_exists('epoch_now_timestamp')) {
|
||||
@@ -9,6 +10,27 @@ function epoch_now_timestamp()
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('read_duration')) {
|
||||
function read_duration($text)
|
||||
{
|
||||
return Str::readDuration($text);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('plain_text')) {
|
||||
function plain_text($content)
|
||||
{
|
||||
return trim(preg_replace('/\s\s+/', ' ', strip_tags($content)));
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('markdown_min_read')) {
|
||||
function markdown_min_read($markdown)
|
||||
{
|
||||
return read_duration(plain_text(Markdown::convert($markdown)->getContent()));
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('unslug')) {
|
||||
function unslug($slug, $delimiter = '-')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user