{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/10664","labels_url":"https://api.github.com/repos/laravel/framework/issues/10664/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/10664/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/10664/events","html_url":"https://github.com/laravel/framework/issues/10664","id":112186868,"number":10664,"title":"elixir() helper includes hardcoded paths, while the mix.version() don't","user":{"login":"igorsantos07","id":532299,"avatar_url":"https://avatars.githubusercontent.com/u/532299?v=3","gravatar_id":"","url":"https://api.github.com/users/igorsantos07","html_url":"https://github.com/igorsantos07","followers_url":"https://api.github.com/users/igorsantos07/followers","following_url":"https://api.github.com/users/igorsantos07/following{/other_user}","gists_url":"https://api.github.com/users/igorsantos07/gists{/gist_id}","starred_url":"https://api.github.com/users/igorsantos07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorsantos07/subscriptions","organizations_url":"https://api.github.com/users/igorsantos07/orgs","repos_url":"https://api.github.com/users/igorsantos07/repos","events_url":"https://api.github.com/users/igorsantos07/events{/privacy}","received_events_url":"https://api.github.com/users/igorsantos07/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T16:50:29Z","updated_at":"2015-10-19T16:50:29Z","closed_at":null,"body":"When using Elixir versioning task, you can provide a specific path for your assets to be saved at. \r\nHowever, the `elixir()` Blade helper contains **hardcoded** paths, rendering the second argument for `mix.version()` useless.\r\n\r\n### Example:\r\n```js\r\nelixir(function(mix) {\r\n  mix.less(['*.less', 'public/css/styles.css']);\r\n  mix.coffee(['*.coffee', 'public/js/app.js']);\r\n  mix.version(['css/styles.css', 'js/app.js'], 'public');\r\n});\r\n```\r\n```html\r\n<script src=\"{{ elixir('js/app.js') }}\"></script>\r\n```\r\n\r\n### Results in:\r\n> ErrorException in helpers.php line 273:\r\n> file_get_contents(/var/www/public/build/rev-manifest.json): failed to open stream: No such file or directory\r\nAs per the `mix.version()` call, the `rev-manifest.json` file was saved to `public`, not `public/build`, but [the `elixir()` helper does not know it](https://github.com/laravel/framework/blob/5.1/src/Illuminate/Foundation/helpers.php#L273 (a couple of lines below it also returns a fixed path for the file that was asked).\r\n\r\n### Suggestion of fix:\r\nI'm a newbie in Laravel so I'm not yet pushing a PR directly, but this is my bet on the fix: the build dir, specified on `mix.version()` should be stored in `rev-manifest.json`. Also, that manifest file should be saved in a fixed place, regardless of the build path - say, in `/public`, since this is a \"fixed\" dir in Laravel dir structure."}}