haubar / autoasset by haubar

automatic asset for Laravel
6
0
3
Package Data
Maintainer Username: haubar
Maintainer Contact: haubarclack@gmail.com (haubar)
Package Create Date: 2015-01-22
Package Last Update: 2015-01-23
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:17:00
Package Statistics
Total Downloads: 6
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

#Auto Asset for laravel

加入
"repositories": [ { "type": "git", "url": "https://github.com/haubar/autoasset.git" } ],

在`composer.json`下指令

composer require kerkerker/autoasset

app/config/app.php 裡的 Providers 裡加入

'Kerkerker\Autoasset\AssetServiceProvider'

app/config/app.php 裡的 aliases 裡加入

'Asset' => 'Kerkerker\Autoasset\Asset'

在要使用的blade樣版中使加入

 `{{ Asset::style('') }}`
 `{{ Asset::script('') }}`

會自動加入網址對應檔案的CSS 及 javascript

example:

  `http://laravel.local/register`
  `<link media="all" type="text/css" rel="stylesheet" href="http://laravel.local/register.css">`

config 可另外加入path參數