-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show warning when manifest is outdated #729
Conversation
Method name doesn't make sense to me. Make it something like "assetsAreCurrent" or "assetsOutOfDate" |
Renamed to |
Why not autoupdate the assets? |
The browser usually runs with different permissions and there is no hook in composer to define in this package (only in the root package) |
$publishedPath = public_path('vendor/telescope/mix-manifest.json'); | ||
|
||
if (! File::exists($publishedPath)) { | ||
throw new \RuntimeException('The Telescope assets are not published. Please run: php artisan telescope:publish'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a custom exception (like TelescopeAssetsNotPublishedException
) that implements ProvidesSolution
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it could yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what isn't clear about this error and the solution though :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be a button to run Artisan::call('telescope:publish')
, similarly to the migrate button when a table is not found.
@barryvdh can you make a PR for Laravel Horizon? |
I don't think @driesvints was convinced yet. |
@barryvdh but i think it is better to do the same in Horizon and Telescope :) @driesvints |
Sorry, I'm still opposed to do anything about this in the UI. But feel free to make the pr to see if Taylor will accept it. |
This adds a check to the base view to show a warning when the manifest file in the public folder is different from the one in the vendor dir. This prevents broken components or missing updates.
The exception is also updated to make it more clear.
Related: #594