I'm using laravel 5.3 and everything was fine until I try to create a new method in my controller, it tells me that it does not exist even though it's there if I put the method in another controller if it works these are my routes
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('auth/google', 'GoogleController@redirectToProvider')->name('google.login');
Route::get('auth/google/callback', 'GoogleController@handleProviderCallback');
Route::get('/mapa', 'MapaController@index');
Route::post('/video', 'VideosController@subirvideo');
Route::get('/home', 'HomeController@index');
Route::group(['middleware' => 'admin'], function () {
Route::get('/registra', 'HomeController@registra');
Route::post('/registro', 'HomeController@registro');
Route::post('/actualizae', 'HomeController@actualiza_estado');
Route::post('/actualizamail', 'HomeController@actualiza_correo');
Route::post('/elimina', 'HomeController@elimina_usuario');
Route::get('/mapaadmin', 'HomeController@probando');
});
all work except for the last @probando
the controller code is as follows:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Socialite;
use Auth;
use App\User;
use DB;
use Alert;
class HomeController extends Controller
{
public function __construct()
{
$this->middleware('admin');
}
public function index()
{
return view('/');
}
public function reigstra()
{
$estados=DB::table('estados')->get();
$usuarios = DB::table('users')->paginate(10);
return view('register', ['estados' => $estados], ['usuarios' => $usuarios]);
}
public function probando()
{
return view('/');
}
public function actualiza_estado()
{
DB::table('users')
->where('email', $_POST['userid'])
->update(['id_estado' => $_POST['id_estado']]);
}
public function elimina_usuario()
{
DB::table('users')->where('id', $_POST['id'])->delete();
}
public function actualiza_correo()
{
DB::table('users')
->where('id', $_POST['id'])
->update(['email' => $_POST['correo']]);
}
public function registro()
{
$revisacorreo=DB::table('users')->where('email','=',$_POST['email'])->value('email');
if($_POST['email']==$revisacorreo)
{
Alert::error('El usuario '.$_POST['email'].' ya se encuentra dado de alta', 'Imposible dar de alta')->persistent('Cerrar');
return back();
}
else{
DB::table('users')->insert(['email' => $_POST['email'], 'id_estado' => $_POST['estado']]);
Alert::success('El usuario '.$_POST['email'].' fue dado de alta', 'Usuario creado con exito')->persistent('Cerrar');
return back();
}
}
} but he sent me the following error
ReflectionException in Route.php line 333: Method App \ Http \ Controllers \ HomeController :: testing () does not exist
help please