Hi all,
Hope you’re well!
I’m just wondering how you, personally, might approach integrating Kirby with an existing Laravel application at “the PHP level” (i.e. without using the REST API) - if this is even possible.
In an ideal world, Laravel would handle the routing, authentication, presentation, and “framework” stuff and Kirby would handle the content - almost in a Statamic-esque way. I would use Statamic but I prefer the way that Kirby handles files and content, and I like Kirby’s API.
To give you a concrete example of what I’m asking, an extremely basic example would be:
- A user visits
/contact
which is handled by a Laravel controller - The Laravel controller calls
page('contact')
and Kirby returns the relevant object - The object is passed to a Blade template
Alternatively: from within a Laravel controller site()->index()
could be called to return a collection of all pages.
I hope that you get the gist. I would like to use the content management API of Kirby within Laravel.
My instinct is that this would be quite finicky to do, would be rife with instability, and is not an idea worth pursuing. I just wanted to get a quick opinion from the Kirby Experts™ before I wrote this off completely.
Thank you for your input in advance! Any opinions are much appreciated.