Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined method Illuminate\Routing\RouteFileRegistrar::get() - Error after upgrading from Laravel 5.7 to 5.8

I have a running app written on Laravel 5.7. I tried to change the record in composer.json to match "5.8.*" and ran composer update. On my local (win10/WAMP) machine it went fine, but on the staging server (Debian 9/nginx) the update command changed the vendor contents and failed at the end. Since then anything I do with the app on the server I get this error and I can't find any information anywhere.

Call to undefined method Illuminate\Routing\RouteFileRegistrar::get()

And this is the line that fails:

$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');

Thanks in advance!

like image 316
Boyan Avatar asked May 19 '19 01:05

Boyan


People also ask

Where are routes in Laravel?

All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by your application's App\Providers\RouteServiceProvider. The routes/web.php file defines routes that are for your web interface.

What is route model binding in Laravel?

Laravel route model binding provides a convenient way to automatically inject the model instances directly into your routes. For example, instead of injecting a user's ID, you can inject the entire User model instance that matches the given ID.

How do I inject a Laravel model into a route?

When injecting a model ID to a route or controller action, you will often query the database to retrieve the model that corresponds to that ID. Laravel route model binding provides a convenient way to automatically inject the model instances directly into your routes.

Does method illuminate\routing\routeregistrar::withoutmiddleware exist?

Method Illuminate\Routing\RouteRegistrar::withoutMiddleware does not exist. · Issue #35362 · laravel/framework · GitHub


1 Answers

remove "$this" from your routes and use "Route::"

like image 106
Abed Bilani Avatar answered Sep 20 '22 07:09

Abed Bilani