1.laravel created a new resource controller
class UserController extends Controller
{
public function index()
{
echo "i am index";
}
public function create()
{
echo "i am create";
}
public function store(UserRequest $request)
{
echo "i am store";
}
public function show(User $user)
{
echo "i am show";
}
public function edit(User $user)
{
echo "i am edit";
}
public function update(Request $request, User $user)
{
echo "i am update";
}
public function destroy(User $user)
{
echo "i am destroy";
}
}
use postman to test according to the corresponding resource routing on the network
post /user,laravel postcsrf,,http/middleware/verifycsfToken.php
csrf,edit
there are several problems:
1. Why do you have this problem? shouldn"t you access the store method? why do you visit edit?
2. How to deal with the problem of csrf when testing post mode in postman