Support the ongoing development of Laravel.io →
Laravel Dusk Octane

Hi,

After migration to Laravel Octane, the dusk tests fails with 419 Page Expired. Before the migration, everything was fine...

I made the following change to the name file docker/8.1/supervisord.conf

-command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=swoole --host=0.0.0.0 --port=80
+command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
  • Laravel Version: 8.82.0
  • Laravel Sanctum: 2.14.0
  • Octane Version: 1.2.0
  • Dusk Version: 6.22.0
  • PHP Version: 8.1.1
  • Database Driver & Version: MySQL 8
  • OS: macOS 12.2

My part of .env.local.dusk file:

APP_ENV=local
OCTANE_SERVER=swoole
BROADCAST_DRIVER=pusher
CACHE_DRIVER=memcached
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_DOMAIN=laravel.test

My the dusk test:

        $this->browse(function (Browser $browser) use ($user) {
            $browser
                ->visit(new Login())
                ->loginUser($user->email, 'password')
                ->assertSee('Dashboard')
                ->assertPathIs('/dashboard')
                ->assertAuthenticatedAs($user)
            ;
        });
class Login extends Page
{
    public function loginUser(Browser $browser, string $email, string $password)
    {
        $browser
            ->type('@email', $email)
            ->type('@password', $password)
            ->press('@button')
        ;
    }
}

Regards! :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.