Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

3ev/laravel-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

3ev's Laravel asset helpers

This library is used internally at 3ev as part of a custom Laravel asset pipeline. It's not yet ready for public use, but feel free to play around with it.

Installation

$ composer require "3ev/laravel-assets:~1.0"

Then, you'll need to add the following service provider to your app.php:

// config/app.php

return [
    'providers' => [
        'Tev\Assets\Providers\AssetsServiceProvider'
    ]
];

and publish the package config:

$ php artisan vendor:publish --provider="Tev\Assets\Providers\AssetsServiceProvider"

Usage

The default configuration sets up assets to be loaded from public/build/assets/, with the revision manifest file (from gulp-rev) configured at public/build/assets/rev-manifest.json.

The library provides a simple helper method which will load a versioned or unversioned asset seemlessly from public/build/assets/. For example, to load a compiled CSS file you might add the following to your template:

<link rel="stylesheet" type="text/css" href="{{ tev_asset('css/style.css') }}" />

or to load a static image you might do:

<img src="{{ tev_asset('img/logo.png') }}" title="My Logo" alt="My Logo" />