Looking to hire Laravel developers? Try LaraJobs

laravel-asset-pipeline maintained by artisan

Description
Asset pipeline library for Laravel.
Author
Last update
2019/03/31 23:39 (dev-master)
License
Links
Downloads
44

Comments
comments powered by Disqus

Laravel Asset Pipeline

This is a Laravel package that provides a pipeline for assets.

Installation

composer require humans/laravel-asset-pipeline

Configuration

Let's publish the default config so we can transform our assets.

php artisan vendor:publish --tags=asset-pipeline

We'll get a config file in config/laravel-asset-pipeline.php.

<?php

return [
    'path' => resource_path('assets'),

    'pipeline' => [
    ],
];

The pipes can take in different formats of callables.

<?php

return [
    'pipeline' => [
        // For quick or small manpulations!
        function ($request, $asset) {
            return $asset;
        },

        // I won't particularly use this but it's there!
        [$object, 'method'],


        // This needs to have a `handle($request, $asset)` method.
        SomeClass::class,
    ],
];