'middleware auth with except method dont work for a parameter

My problem is that :

$this->middleware('auth', ['except'=>'getInfos', 'store']);

My getInfos except is working, but the store method dont work, i cant understand why, you can see in the picture below my rout list (in the terminal).

picture of my code here

I searched everywhere for nothing, do you see a difference between store and GetInfos ?

Thanks in advance all !



Solution 1:[1]

I am assuming you are using react router dom v5.

The way you are passing state to link seems fine to me, now lets come to what can go wrong here :)

  1. How to access that state in the respective component.

    Use useLocation hook

    const { state } = useLocation; (hooks can only be used in custom hooks and react components only)

  2. If from first approach you still get it undefined:

    a. Try to check the value you are passing as state to link, whether its undefined or not.

    b. Check if you are using the first approach correctly or not.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Siddharth Agrawal