Route error when accessing the page in Laravel

1

  

composer require mnabialek / laravel-eloquent-filter

The error below appears, I did not make any changes besides executing this command. ReflectionException in Route.php line 333: Method App \ Http \ Controllers \ AdvertisementController :: details () does not exist

After this I tried composer install and composer update but nothing worked.

Below the code of my controller

<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;
use App\Http\Requests\AnunciosRequest;
use Illuminate\Http\Request;
use App\Anuncio;


class AnuncioController extends Controller {

    public function detalhes($id) {
        $animal = Anuncio::find($id);

        return view('anuncio.detalhes')->with('detalhe', $animal);
    }

My routes.php file is correct, no changes, the first page works, but I do not know what happened;

/* Rota para listar os produtos cadastrados */
Route::get("/", "HomeController@index");
Route::get("/anuncios/detalhes/{id}", "AnuncioController@detalhes");
    
asked by anonymous 23.10.2016 / 02:36

1 answer

1

To solve this case it was necessary to create the controller that was previously used.

run the following command:

php artisan make:controller AnunciarController

After copying the function to this new controller and changing its name in the detail route, the error was no longer displayed.

    
23.10.2016 / 04:21