{"id":28438098,"url":"https://github.com/zanysoft/laravel-assets","last_synced_at":"2025-10-05T09:18:35.952Z","repository":{"id":52306387,"uuid":"231546938","full_name":"zanysoft/laravel-assets","owner":"zanysoft","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-03T13:48:32.000Z","size":1282,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T00:43:14.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanysoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-03T08:39:54.000Z","updated_at":"2022-08-03T13:35:37.000Z","dependencies_parsed_at":"2022-08-20T16:00:40.560Z","dependency_job_id":null,"html_url":"https://github.com/zanysoft/laravel-assets","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zanysoft/laravel-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanysoft","download_url":"https://codeload.github.com/zanysoft/laravel-assets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-assets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262452363,"owners_count":23313428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T00:39:15.555Z","updated_at":"2025-10-05T09:18:35.865Z","avatar_url":"https://github.com/zanysoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel \u003e= 5 Assets\n[![Latest Stable Version](https://poser.pugx.org/zanysoft/laravel-assets/v/stable.svg)](https://packagist.org/packages/zanysoft/laravel-assets/)\n[![Total Downloads](https://img.shields.io/packagist/dt/zanysoft/laravel-assets.svg)](https://packagist.org/packages/zanysoft/laravel-assets)\n[![License](https://poser.pugx.org/zanysoft/laravel-assets/license.svg)](https://packagist.org/packages/zanysoft/laravel-assets)\n\nWith this package you can combine and minify your existing css and javascript files automatically. \n\n## Installation\n\nBegin by installing this package through Composer.\n\nRun ```composer require zanysoft/laravel-assets ```\n\n```php\n\n// config/app.php\n\n'providers' =\u003e [\n    '...',\n    'ZanySoft\\LaravelAssets\\AssetsServiceProvider',\n];\n\n'aliases' =\u003e [\n    '...',\n    'Assets'    =\u003e 'ZanySoft\\LaravelAssets\\Facade',\n];\n```\n\nPublish the config file:\n\n```\nphp artisan vendor:publish  --provider=\"ZanySoft\\LaravelAssets\\AssetsServiceProvider\"\n```\n\nNow you have a ```Assets``` facade available.\n\n#### CSS\n\n```php\n// resources/views/hello.blade.php\n\n\u003chtml\u003e\n    \u003chead\u003e\n        // Pack a simple file\n        {{ Assets::css('/css/main.css', '/storage/cache/css/main.css') }}\n\n        // Pack a simple file using cache_folder option as storage folder to packed file\n        {{ Assets::css('/css/main.css', 'css/main.css') }}\n\n        // Packing multiple files\n        {{ Assets::css(['/css/main.css', '/css/bootstrap.css'], '/storage/cache/css/styles.css') }}\n\n        // Packing multiple files using cache_folder option as storage folder to packed file\n        {{ Assets::css(['/css/main.css', '/css/bootstrap.css'], 'css/styles.css') }}\n\n        // Packing multiple files with autonaming based\n        {{ Assets::css(['/css/main.css', '/css/bootstrap.css'], '/storage/cache/css/') }}\n\n        // pack and combine all css files in given folder\n        {{ Assets::cssDir('/css/', '/storage/cache/css/all.css') }}\n\n        // pack and combine all css files in given folder using cache_folder option as storage folder to packed file\n        {{ Assets::cssDir('/css/', 'css/all.css') }}\n\n        // Packing multiple folders\n        {{ Assets::cssDir(['/css/', '/theme/'], '/storage/cache/css/all.css') }}\n\n        // Packing multiple folders with recursive search\n        {{ Assets::cssDir(['/css/', '/theme/'], '/storage/cache/css/all.css', true) }}\n\n        // Packing multiple folders with recursive search and autonaming\n        {{ Assets::cssDir(['/css/', '/theme/'], '/storage/cache/css/', true) }}\n\n        // Packing multiple folders with recursive search and autonaming using cache_folder option as storage folder to packed file\n        {{ Assets::cssDir(['/css/', '/theme/'], 'css/', true) }}\n    \u003c/head\u003e\n\u003c/html\u003e\n```\n\nCSS `url()` values will be converted to absolute path to avoid file references problems.\n\n#### Javascript\n\n```php\n// resources/views/hello.blade.php\n\n\u003chtml\u003e\n    \u003cbody\u003e\n    ...\n        // Pack a simple file\n        {{ Assets::js('/js/main.js', '/storage/cache/js/main.js') }}\n\n        // Pack a simple file using cache_folder option as storage folder to packed file\n        {{ Assets::js('/js/main.js', 'js/main.js') }}\n\n        // Packing multiple files\n        {{ Assets::js(['/js/main.js', '/js/bootstrap.js'], '/storage/cache/js/styles.js') }}\n\n        // Packing multiple files using cache_folder option as storage folder to packed file\n        {{ Assets::js(['/js/main.js', '/js/bootstrap.js'], 'js/styles.js') }}\n\n        // Packing multiple files with autonaming based\n        {{ Assets::js(['/js/main.js', '/js/bootstrap.js'], '/storage/cache/js/') }}\n\n        // pack and combine all js files in given folder\n        {{ Assets::jsDir('/js/', '/storage/cache/js/all.js') }}\n\n        // pack and combine all js files in given folder using cache_folder option as storage folder to packed file\n        {{ Assets::jsDir('/js/', 'js/all.js') }}\n\n        // Packing multiple folders\n        {{ Assets::jsDir(['/js/', '/theme/'], '/storage/cache/js/all.js') }}\n\n        // Packing multiple folders with recursive search\n        {{ Assets::jsDir(['/js/', '/theme/'], '/storage/cache/js/all.js', true) }}\n\n        // Packing multiple folders with recursive search and autonaming\n        {{ Assets::jsDir(['/js/', '/theme/'], '/storage/cache/js/', true) }}\n\n        // Packing multiple folders with recursive search and autonaming using cache_folder option as storage folder to packed file\n        {{ Assets::jsDir(['/js/', '/theme/'], 'js/', true) }}\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Config\n\n```php\nreturn array(\n\n    /*\n    |--------------------------------------------------------------------------\n    | App environments to not pack\n    |--------------------------------------------------------------------------\n    |\n    | These environments will not be minified and all individual files are\n    | returned\n    |\n    */\n\n    'ignore_environments' =\u003e ['local'],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Base folder to store packed files\n    |--------------------------------------------------------------------------\n    |\n    | If you are using relative paths to second paramenter in css and js\n    | commands, this files will be created with this folder as base.\n    |\n    | This folder in relative to 'public_path' value\n    |\n    */\n\n    'cache_folder' =\u003e '/storage/cache/',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Check if some file to pack have a recent timestamp\n    |--------------------------------------------------------------------------\n    |\n    | Compare current packed file with all files to pack. If exists one more\n    | recent than packed file, will be packed again with a new autogenerated\n    | name.\n    |\n    */\n\n    'check_timestamps' =\u003e true,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Check if you want minify css files or only pack them together\n    |--------------------------------------------------------------------------\n    |\n    | You can check this option if you want to join and minify all css files or\n    | only join files\n    |\n    */\n\n    'css_minify' =\u003e true,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Check if you want minify js files or only pack them together\n    |--------------------------------------------------------------------------\n    |\n    | You can check this option if you want to join and minify all js files or\n    | only join files\n    |\n    */\n\n    'js_minify' =\u003e true,\n);\n```\n\nIf you set the `'check_timestamps'` option, a timestamp value will be added to final filename.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanysoft%2Flaravel-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-assets/lists"}