General discussion
Inertia + Slim/Twig as server-side


Started this discussion 2 months ago

Hello @alex, I was wondering if a course with Slim/Twig instead of Laravel/Blade as a server side for Inertia would be of interest to anyone other than me.


Replied 2 months ago

Hey Giorgio, thanks for the request!

Really curious about your use-case for this, since with Inertia you don't use server-side templating much apart from the base template.

Let me know so I can better understand and I'd be happy to see if it's possible and create a snippet :)


Replied 1 month ago

sorry @alex, re-reading my question, I think the title is just wrong... it was probably better if I wrote "What do you think about replacing Laravel with Slim as backend in an Inertia app?".

I'll explain. I have several applications written using Slim + Twig as page renderer. Some without Eloquent but simple PDO or DBAL. It would be interesting to be able to improve them using Inertia with Vue.js as frontend, but keeping all business logic written without using Laravel ORM and facades.

I saw that there is a generic adapter for PSR-15 ( which requires, as you rightly wrote, only to render a home page for the SPA assets and to do this it displays an example where it uses Twig (fullpipe/twig-webpack-extension) and Mezzio instead of Slim. So that's why I was talking about Slim+Twig, but I understand that Blade has nothing to do with it.

So I try to rephrase my request: considering that you took a course on Inertia from scratch, why not also talk about an alternative to using Laravel as a backend? And considering you've always looked at Slim, I thought it might be interesting to implement a PSR-15 middleware.

Thank you for your answer. I hope I have clarified my post.