A simple PHP asset library.
composer require michaeljdennis/phasset
use Phasset\Phasset;
$phasset = new Phasset();
$phasset->add('reset.css');
$phasset->add('styles.css');
$phasset->add('scripts.js');
$phasset->css();
// <link media="all" type="text/css" rel="stylesheet" href="reset.css">
// <link media="all" type="text/css" rel="stylesheet" href="styles.css">
$phasset->js();
// <script src="scripts.js"></script>
Add service provider to the providers
array in /config/app.php
.
Phasset\PhassetServiceProvider::class,
Add facade to the facades
array in /config/app.php
.
'Phasset' => Phasset\Facades\Laravel\Phasset::class,
Use facade to access methods.
Phasset::add('reset.css');
Phasset::add('styles.css');
Phasset::add('scripts.js');
Phasset::css();
Phasset::js();
- PSR-4 autoloading.