Question: I have a Base controller which providers basic implementations of some actions:

```
[Route("api/[controller]")]
public class BaseAppController : Controller
{...

```

I have several controllers that derive from this and they are called using the routing from the base controller. They add various functionality. For example:

```
public class SomeController : BaseAppController
{
... more stuff ...
}

```

Now when the request goes to 

> 
> <http://appurl/Some/MyAction>
> 
> 
> 

it obviously uses the MyAction which is either in the SomeController or in BaseAppController.

What I want to achieve is that if I send a request to:

> 
> <http://appurl/NonExistent/MyAction>
> 
> 
> 

I want it to determine that NonExistentController doesn't exist and revert to using the BaseAppController instead.

Any pointers would be welcome.

Answer: 
You can pass them from javascript with some event. You cannot just retrieve them in controller, because its server side.
I will extend @kamgas answer

You could set it in a cookie instead of local storage, which will allow Laravel to read the cookie

To fetch the cookie with Laravel you should use:

```
Cookie::get('mycookie')

```

Since Laravel by default only allow Laravel to read Laravel encrypted cookies you will need to set an exception in the `App\Http\Middleware\EncryptCookies` middleware class

```
protected $except = [
    'mycookie',
];

```