Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tasarsu's avatar

Is it possible to use Laravel Vapor UI without session?

Hi, I have an api which I don't use session I only have token based auth.

When I try to open vapor-ui dashboard I got the error below. Is it possible to use Laravel Vapor UI without session?

{
  "message": "Target class [session] does not exist. (View: /var/task/vendor/laravel/vapor-ui/resources/views/layout.blade.php)",
  "context": {
    "view": {
      "view": "/var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php",
      "data": []
    },
    "exception": {
      "class": "Facade\Ignition\Exceptions\ViewException",
      "message": "Target class [session] does not exist. (View: /var/task/vendor/laravel/vapor-ui/resources/views/layout.blade.php)",
      "code": 0,
      "file": "/var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php:838",
      "previous": {
        "class": "Illuminate\Contracts\Container\BindingResolutionException",
        "message": "Target class [session] does not exist.",
        "code": 0,
        "file": "/var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php:838",
        "previous": {
          "class": "ReflectionException",
          "message": "Class \"session\" does not exist",
          "code": -1,
          "file": "/var/task/vendor/laravel/framework/src/Illuminate/Container/Container.php:836"
        }
      }
    }
  }
}
0 likes
3 replies
bobbybouwmann's avatar

Looking at the latest version of the layout.blade.php file from the package, I don't see any reference to any session. Also no reference to the session in the rest of the codebase. It's a full VUE frontend webpage, so there shouldn't be a session involved at all.

The only thing I can think of is that the authorization step is not working correctly. Maybe you need to change this to work with your token somehow? If you're working with the token you probably need to pass it to the VUE application as well. Otherwise, it can't know about it: https://docs.vapor.build/1.0/introduction.html#installing-the-vapor-ui-dashboard

It's probably also good to check if you're on the latest version or not.

tasarsu's avatar

Hi @bobbybouwmann, thank you for your reply, In authorization step I returned true directly but no difference.

In layout.blade.php csrf_token() function is called, and that function uses app('session'). I think this is cause of the problem. I tried to bypass csrf_token function but couldn't be able to do it

bobbybouwmann's avatar

@tasarsu Yeah, you can't get around that.

In this case, it's probably wise to set up a way to authenticate using a session as well. Only for the dashboard part. Remember that the dashboard is built with a certain default in mind.

Please or to participate in this conversation.