Kentico Kontent sample Laravel PHP web application
There should be PHP7.2 and higher and composer installed in your environment. Once these prerequisites are met, you run the application as follows:
- Clone this repository.
cdin the project folder and run
php artisan servecommands.
127.0.0.1:8000(default) to browse the application.
Alternatively you can also deploy your application to your apache server just by cloning the repository, running composer update and accessing corresponding address on your server.
Connecting your project
This sample website displays content from a Sample Project that demonstrates Kentico Kontent features and best practices. This fully featured project contains marketing content for Dancing Goat – an imaginary chain of coffee shops. By default, this sample website uses a shared project where the content remains constant for everyone.
You can change the source Kentico Kontent project to your own project to be able to change the content. If you don't have your own Sample Project, any admin of a Kentico Kontent subscription can generate one. When you have a Sample Project, follow these steps to connect it to this sample website:
- In Kentico Kontent, choose Project settings from the app menu.
- Under Development, choose API keys.
- Copy your Project ID.
app\Providers\AppServiceProvider.phpfile in the sample application folder.
new DeliveryClient('975bf280-fd91-488c-994c-2f04416e5ee3');and replace guid with your Project ID.
- Save the file.
Now when you run the sample application, content is retrieved from your project.
- Navigate to https://app.kontent.ai in your browser.
- Sign in with your credentials.
- Manage content in the content administration interface of your sample project.
You can learn more about content editing with Kentico Kontent in the documentation.
You can retrieve content either through the Kentico Kontent Delivery SDKs or the Kentico Kontent Delivery API:
- For published content, use
- For unpublished content, use
For more info about the API, see the API reference.
You can find the Delivery and other SDKs at Kentico Github Organization.
Kub-AT's HTML DOM parser
When using this sample application with some versions of PHP (reproduced on v 7.3.7), one of the dependencies (kub-AT/php-simple-html-dom-parser) tends to get stuck in an endless loop of calls to its own destructor. We worked-around this issue by renaming destructors in fetched dependencies every time they are changed. For futher reference, please see the issue in package's repository repository and (original package issue)[https://sourceforge.net/p/simplehtmldom/support-requests/49/].
Feedback & Contributing
Check out the contributing page to see the best places to file issues, start discussions, and begin contributing.
Developing on Windows
Have a look at our cool tutorial on developing PHP on Windows with Visual Studio Code!
Developing on Linux
Do you prefer penguins? Check out our tutorials on developing PHP on Linux with PhpStorm!
We would like to express our thanks to Stephen Rushing who created this sample application.