Skip to content
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

Remove use directive #1537

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Remove use directive #1537

merged 1 commit into from
Sep 29, 2022

Conversation

nagmat84
Copy link
Collaborator

Might be fixing #1536 (I don't know for sure).

Issue #1536 is caused by Laravel trying to invoke the method cacheBusting on the wrong class. Laravel wrongly uses \App\Assets\Helpers instead of \App\Facades\Helpers.

I don't know why this happens, because I cannot reproduce it. The methods is called from within the Blade template

<link type="text/css" rel="stylesheet" href="{{ Helpers::cacheBusting('dist/main.css') }}">

And the Blade template is called in

return view('gallery', [

Neither the Blade template nor the class IndexController explicitly import the class \App\Facades\Helpers. Hence the Laravel auto-loader should kick in. (I have told you how much I hate this "magic", haven't I?) and resolve the class \App\Facades\Helpers. But for some reason we end up with \App\Assets\Helpers. The only plausible explanation which I can conjuncture is that somehow the (wrong) class \App\Assets\Helpers gets loaded first. Hence, I looked around where this class is loaded explicitly, found a single occurrence and fixed that.

I don't know, if this PR will really fix the bug. It is more like an educated guess. However, this PR shouldn't do any harm either.

@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Merging #1537 (5b7c5ef) into master (61b93a6) will decrease coverage by 0.73%.
The diff coverage is n/a.

Additional details and impacted files

@ildyria ildyria merged commit 52ea5b8 into master Sep 29, 2022
@ildyria ildyria deleted the fixes-1536 branch September 29, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants