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

Class Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist #230

Closed
raymondTheDev opened this issue Apr 22, 2020 · 12 comments
Closed
Assignees
Labels

Comments

@raymondTheDev
Copy link

Just did a composer update on a Laravel project and now it's showing.

Class Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist

This was working fine before the composer update

Thank you.

@mikemand
Copy link
Contributor

Make sure you are dumping the autoloader when you update:

composer update -oa

@raymondTheDev
Copy link
Author

Hi @mikemand

Yeah been trying that and it didn't work for me. Is the package working for you right now?

For the mean time, this is how I'm making it work.
web.php:
Route::get('logs', 'HomeController@viewLogs');

HomeController.php:
use Rap2hpoutre\Controllers\LogViewerController;
public function viewLogs(){ $log = new LogViewerController(); return $log->index(); }

@avesgit
Copy link

avesgit commented Apr 22, 2020

same problem

@mikemand
Copy link
Contributor

Yes, it's working for me. Are your routes cached? Check the /bootstrap/cache directory. You can safely remove any *.php files in that directory, they will be generated by Laravel on the next page load.

@mikemand
Copy link
Contributor

Oh, no sorry. My fault, I was checking a site with an old version still. The new one isn't working for me. I'm investigating.

@mikemand
Copy link
Contributor

mikemand commented Apr 22, 2020

Ok, I got it working. I used the class-based way of routing, but it should work for the original string-based way too.

Route::get('logs', [\Rap2hpoutre\Controllers\LogViewerController::class, 'index'])

Edit: I think I see the problem. The namespace changed for the controller. Instead of \Rap2hpoutre\LaravelLogViewer\LogViewerController it is now \Rap2hpoutre\Controllers\LogViewerController

@raymondTheDev
Copy link
Author

I think that's the issue! We would just need to update the README file in regards to the update.

Thank you @mikemand !

@mikemand
Copy link
Contributor

In my opinion, Composer needs some way to supply upgrade steps (if applicable) when it is upgrading packages. I spend more time checking each package for an upgrade guide (and if they don't have one, comparing versions) than I do coding sometimes. 😢

Glad you got it working!

@rap2hpoutre
Copy link
Owner

Oops. I should not have merged #227 that fast. I re-open this issue since it's a problem that other people may have in the next days. I'm not sure I have to fix this or leave as is and write something in README though...

@rap2hpoutre
Copy link
Owner

rap2hpoutre commented Apr 23, 2020

Hi @raymondTheDev @mikemand @Scaenicus @tiagoa @DjeeBay @timothymarois & @avesgit !

Thank you for your patience and sorry for the mess. I merged a PR that introduced a breaking change and released it in a minor version (v1.5.0): my bad, I'm sorry about that.

⚠️ I decided (hope I'm not wrong again!) to revert this change in v1.5.2 (I consider reverting as a fix of a regression). 🔥

Unfortunately, it means that you will have to revert your change too, I'm sincerely sorry. Since only 20+ hours as passed since the release I guess we could consider not too much projects are affected, and the next users that will upgrade would not see the problem. I prefer preserving the semantical version (again maybe I'm wrong and sorry for the mess) to avoid unexpected behavior for other users.

Feel free to send me feedback!

@rap2hpoutre
Copy link
Owner

In other words, you have to update then keep using:

\Rap2hpoutre\LaravelLogViewer\LogViewerController

@rap2hpoutre
Copy link
Owner

Resolved now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants