Update (view): redesign

This commit is contained in:
2023-10-05 00:29:23 +08:00
parent f1f02bb7b6
commit 7374d66a21
14 changed files with 104 additions and 49 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
class AppServiceProvider extends ServiceProvider
{
@@ -19,6 +20,11 @@ public function register(): void
*/
public function boot(): void
{
//
Str::macro('readDuration', function (...$text) {
$totalWords = str_word_count(implode(' ', $text));
$minutesToRead = round($totalWords / 200);
return (int) max(1, $minutesToRead).' min read';
});
}
}