承接 simexis/laravel-casset 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

simexis/laravel-casset

Composer 安装命令:

composer require simexis/laravel-casset

包简介

An asset management package for Laravel 5.

README 文档

README

This package is baset on https://github.com/mmanos/laravel-casset

Casset is an asset manager for Laravel 5 applications. Some things it can do:

  • Create one or more asset containers.
  • Compile less files.
  • Combine assets into one file.
  • Minify output.
  • Accept assets from Laravel package public directories. "package::/js/file.js"
  • Define dependencies for an asset.
  • Define global dependencies for all assets of the same file type.
  • Define an optional CDN for asset URLs.
  • Optionally defer processing/combining assets to a controller (useful when distributing page requests across multiple servers).

Installation via Composer

Add this to your composer.json file, in the require object:

"simexis/laravel-casset": "dev-master"

After that, run composer install to install Casset.

Add the service provider to app/config/app.php, within the providers array.

'providers' => array(
	// ...
	Simexis\Casset\CassetServiceProvider::class,
)

Add a class alias to app/config/app.php, within the aliases array.

'aliases' => array(
	// ...
	'Casset' => Simexis\Casset\Facades\Casset::class,
)

Finally, ensure the cache directory defined in the config file is created and writable by the web server (defaults to public/assets/cache).

$ mkdir public/assets/cache
$ chmod -R 777 public/assets/cache
$ touch public/assets/cache/.gitignore

Edit public/assets/cache/.gitignore.

*
!.gitignore

Usage

Add assets to the "default" container:

Casset::add('js/jquery.js');
Casset::add('less/layout.less');

Add assets to a custom container:

Casset::container('layout')->add('js/jquery.js');
Casset::container('layout')->add('less/layout.less');

Add an asset with a dependency on another asset:

Casset::add('less/variables.less');
Casset::add('less/layout.less', array(), array('less/variables.less'));

Add a global dependency for all assets (of the same file type):

Casset::dependency('less/variables.less');
Casset::container('layout')->dependency('less/variables.less');

Add assets from a composer package (vendorName/packageName):

Casset::add('frameworks/jquery::/jquery.min.js');

Render HTML tags to load assets for a container:

{!! Casset::container('default')->styles() !!}
{!! Casset::container('layout')->scripts() !!}

Generate a URL to an asset on the CDN server:

<img src="{{ Casset::cdn('logo.png') }}" />

统计信息

  • 总下载量: 141
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固