{"id":21815425,"url":"https://github.com/tooleks/laravel-asset-version","last_synced_at":"2025-04-14T00:41:47.125Z","repository":{"id":57071707,"uuid":"62882859","full_name":"tooleks/laravel-asset-version","owner":"tooleks","description":"The Laravel Assets Versioning Package","archived":false,"fork":false,"pushed_at":"2017-06-01T16:25:59.000Z","size":19,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T03:17:57.632Z","etag":null,"topics":["assets","cache","css","js","laravel","laravel-asset","php","versioning"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/tooleks/laravel-asset-version","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/tooleks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-08T11:09:25.000Z","updated_at":"2019-05-29T09:13:32.000Z","dependencies_parsed_at":"2022-08-24T10:40:56.375Z","dependency_job_id":null,"html_url":"https://github.com/tooleks/laravel-asset-version","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooleks%2Flaravel-asset-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooleks%2Flaravel-asset-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooleks%2Flaravel-asset-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tooleks%2Flaravel-asset-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tooleks","download_url":"https://codeload.github.com/tooleks/laravel-asset-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804719,"owners_count":21164127,"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":["assets","cache","css","js","laravel","laravel-asset","php","versioning"],"created_at":"2024-11-27T15:18:51.078Z","updated_at":"2025-04-14T00:41:47.100Z","avatar_url":"https://github.com/tooleks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Laravel 5 Assets Versioning Package\n\nThis package performs versioning of the asset URL resources.\n\nAsset link before versioning:\n```\nhttps://website.domain/path/to/asset.css\n```\nAsset link after versioning:\n```\nhttps://website.domain/path/to/asset.css?v=0.0.1\n```\n\n## Requirements\n\nPHP \u003e= 7.0, Laravel \u003e= 5.0.\n\n## Installation\n\n### Package Installation\n\nExecute the following command to get the latest version of the package:\n\n```shell\ncomposer require tooleks/laravel-asset-version\n```\n\n### App Configuration\n\n#### Service Registration\n\nTo register the service simply add `Tooleks\\LaravelAssetVersion\\Providers\\AssetServiceProvider::class` into your `config/app.php` to the end of the `providers` array:\n\n```php\n'providers' =\u003e [\n    ...\n    Tooleks\\LaravelAssetVersion\\Providers\\AssetServiceProvider::class,\n],\n```\n\nIf you prefer to use the service via facade interface add `'Asset' =\u003e Tooleks\\LaravelAssetVersion\\Facades\\Asset::class` into your `config/app.php` to the end of the `aliases` array:\n```php\n'aliases' =\u003e [\n    ...\n    'Asset' =\u003e Tooleks\\LaravelAssetVersion\\Facades\\Asset::class,\n],\n```\n\n#### Publishing File Resources\n\nRun following command in the terminal to publish the package file resources:\n\n```shell\nphp artisan vendor:publish --provider=\"Tooleks\\LaravelAssetVersion\\Providers\\AssetServiceProvider\" --tag=\"config\"\n```\n\n#### Configure Assets Version\n\nConfigure assets version number in the `config/assets.php`:\n\n```php\n...\n'version' =\u003e '0.0.1',\n...\n```\n\n## Basic Usage Examples\n\n#### Via Service Object\n\n```php\nuse Tooleks\\LaravelAssetVersion\\Contracts\\AssetServiceContract;\n\n$assetUrl = app(AssetServiceContract::class)-\u003eget('path/to/asset.css'); // 'http://website.domain/path/to/asset.css?v=0.0.1'\n\n$secureAssetUrl = app(AssetServiceContract::class)-\u003eget('path/to/asset.css', true); // 'https://website.domain/path/to/asset.css?v=0.0.1'\n```\n\nNote: Secure option will be detected automatically if no second argument will be passed into the function and `secure` option configured to `null` in the `config/assets.php`:\n\n```php\n...\n'secure' =\u003e null,\n...\n```\n\n#### Via Service Facade Class\n\n```php\nuse Tooleks\\LaravelAssetVersion\\Facades\\Asset;\n\n$assetUrl = Asset::get('path/to/asset.css'); // 'http://website.domain/path/to/asset.css?v=0.0.1'\n\n$secureAssetUrl = Asset::get('path/to/asset.css', true); // 'https://website.domain/path/to/asset.css?v=0.0.1'\n```\n\nNote: Secure option will be detected automatically if no second argument will be passed into the function and `secure` option configured to `null` in the `config/assets.php`:\n\n```php\n...\n'secure' =\u003e null,\n...\n```\n\n#### In The Layout (Blade Template)\n```html\n\u003clink href=\"{{ Asset::get('path/to/asset.css') }}\" rel=\"stylesheet\" type=\"text/css\"\u003e\n```\n\n#### In The Layout (PHP Template)\n```html\n\u003clink href=\"\u003c?= Asset::get('path/to/asset.css') ?\u003e\" rel=\"stylesheet\" type=\"text/css\"\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftooleks%2Flaravel-asset-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftooleks%2Flaravel-asset-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftooleks%2Flaravel-asset-version/lists"}