1
I’m starting to work now with Laravel and realized that setting the routes directly to the controls where I can set the type of HTTP request is more feasible for my application. Today I have something like this:
Routes.php
Route::controller("usuario","UsuarioController");
Usuariocontroller.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class UsuarioController extends Controller
{
public function __construct()
{
//$this->middleware("auth");
}
public function getAutenticar()
{
return view("Usuario/Autenticar");
}
}
My question is this. Is there any way I set a manual middleware within control where just for 2 routes I would be free from auth middleware?
I know if I set these routes manually in the file routes.php
works but, doing this I can’t keep working using the request type setting HTTP within my controller.
I can somehow force my controller to accept 2 middleware, 1 for "x" methods and another for other methods?
What was the reason for the negative? Could inform.
– Wallace Maxters