Make octane work
Did someone succefully make laravel octane with frankenphp work with twill cms
I cant seems to make it work dont know why.
When i go to /admin/login and submit the form, i can't see the admin page - it shows ERR_EMPTY_RESPONSE. This means the Octane worker is crashing or hanging when trying to process an authenticated request to the admin dashboard.
The problem is likely that after i authenticate in the browser and submit the login form, when Octane tries to serve the resulting page, something crashes. I would love any info

7 Replies
Why would you even use octane for this?
I use octane for my whole app not for twill just
Its a big app that use twill as cms
The rest of the app work just not the twill part
I believe octane:start can take a custom caddyfile, perhaps you could set it up so only the
/admin routes are handled by php-fpm that wayWill test tonight
Hi! Which Laravel version are you using for you project?
We success to run Twill CMS with FrankenPHP only on v10. If you want, i can write all configurations steps for run Twill with FrankenPHP.
@magius
I am using laravel 11
I would love man
While debuging this i discovered some bug with inertia too cause by franken php for the dashboard part of the site like the larvavel i18n for vue doesnt work anymore
If you've just started your project, it's not too late to switch to v10)
1) Check that the project is using Laravel 10
2) Move all Twill navigation setup into a new middleware called RegisterTwillNavigation.php, and fill it out following the example below. Then, register it in App\Http\Kernel.php.
<?php
namespace App\Http\Middleware;
use A17\Twill\Facades\TwillNavigation;
use App\Extends\NavigationLink;
use Closure;
use Illuminate\Http\Request;
class RegisterTwillNavigation
{
public function handle(Request $request, Closure $next)
{
if ($this->shouldRegisterNavigation($request)) {
$this->registerNavigation();
}
return $next($request);
}
protected function shouldRegisterNavigation(Request $request): bool
{
return str_starts_with($request->path(), 'admin');
}
protected function registerNavigation(): void
{
TwillNavigation::clear();
TwillNavigation::addLink(
NavigationLink::make()->forSingleton('mainPage')->title('Главная')->setChildren([
NavigationLink::make()->forSingleton('contactPage')->title("Контакты"),
NavigationLink::make()->forSingleton('aboutCompany')->title("О компании"),
]));
}
}
In AppServiceProvider.php, inside the boot() method, you need to register the singleton services as shown in the example below.
This is required to ensure the proper initialization of these components in the project.
public function boot(): void
{
$this->app->singleton(
Twill\TwillAppSettings::class,
static fn() => new Twill\TwillAppSettings
);
$this->app->singleton(
Twill\TwillNavigation::class,
static fn() => new Twill\TwillNavigation
);
$this->app->singleton(
Twill\TwillBlocks::class,
static fn() => new Twill\TwillBlocks
);
$this->app->singleton(
Twill\TwillCapsules::class,
static fn() => new Twill\TwillCapsules
);
$this->app->singleton(
Twill\TwillConfig::class,
static fn() => new Twill\TwillConfig
);
$this->app->singleton(
Twill\TwillPermissions::class,
static fn() => new Twill\TwillPermissions
);
$this->app->singleton(
Twill\TwillRoutes::class,
static fn() => new Twill\TwillRoutes
);
$this->app->singleton(
Twill\TwillUtil::class,
static fn() => new Twill\TwillUtil
);
}
@magius it work only for Laravel v10