Laravel package to create a dynamic critical css
Require this package with composer:
composer require alcodo/async-css
Add ServiceProvider in config/app.php
Alcodo\AsyncCss\ServiceProvider::class,
and
'AsyncCss' => Alcodo\AsyncCss\Html\Facade::class,
Add Middleware
protected $middleware = [
\Alcodo\AsyncCss\Middleware\AsyncCssMiddleware::class,
];
Add Commands
protected $commands = [
\Alcodo\AsyncCss\Commands\Clear::class,
\Alcodo\AsyncCss\Commands\Show::class,
\Alcodo\AsyncCss\Commands\Rebuild::class,
];
Add app.balde.php
{!! asyncsss(elixir('style.css')) !!}
MIT