Add an About Box to a PHP App (Laravel, Symfony)
Add an About box to a PHP app in your Blade, Twig or plain PHP layout and pass the app version from Composer. Links and contacts live in AboutTheApp.
Live example
This is the About box of AboutTheApp itself. Switch the variant to see other layouts. The code below renders exactly this box. For your own app, change the alias.
<script src="https://aboutthe.app/embed/web/0.3.5/card.js" integrity="sha384-X3VGSEdTNGsfVKfVUx7sq9ICfpWsJW88HDQYidGPio1KjoxYCbSirTNqtbVfq1sj" crossorigin="anonymous" async></script>
<about-the-app alias="aboutthe.app" variant="card" api-base="https://aboutthe.app/api/v1" visual-style="default" palette="default" appearance="auto"></about-the-app>Add it to a PHP layout in 3 steps
The About box is a Web Component that the browser renders. The PHP app only outputs the script tag and the element, so it needs no Composer package and makes no API calls.
- 1
Create your product
Create it in AboutTheApp and note its alias. The Integrate panel on the product card has the same code as the live example, already filled in with your alias.
- 2
Load the script in the layout
Add the script tag to your main layout once, for example resources/views/layouts/app.blade.php in Laravel or templates/base.html.twig in Symfony.
- 3
Place the element
Put <about-the-app alias="aboutthe.app"></about-the-app> into the footer of the layout or into an About page template.
<footer>
<about-the-app alias="aboutthe.app" variant="footer" version="{{ $appVersion }}"></about-the-app>
</footer>
<script src="https://aboutthe.app/embed/web/v1/abouttheapp.js" async></script>Pass the version from Composer in Laravel
Composer 2 knows the version of your root package. InstalledVersions::getRootPackage() returns it as pretty_version, which is the version field from composer.json or the Git tag the app was installed from. On a branch without a tag, it returns a value such as dev-main.
Share it with all views in AppServiceProvider and the layout above can use it. Release notes appear when the same version exists in the product's version catalog and is public. If you're not sure how to version your app, read app versioning schemes and examples.
use Composer\InstalledVersions;
use Illuminate\Support\Facades\View;
public function boot(): void
{
View::share('appVersion', InstalledVersions::getRootPackage()['pretty_version']);
}Symfony and Twig
In Symfony, define app_version as a Twig global in config/packages/twig.yaml, for example from an APP_VERSION environment variable that your deployment sets. The base template then passes it to the element.
<footer>
<about-the-app alias="aboutthe.app" variant="footer" version="{{ app_version }}"></about-the-app>
</footer>
<script src="https://aboutthe.app/embed/web/v1/abouttheapp.js" async></script>Frequently asked questions
Does the About box need a PHP library?
No. The PHP app only renders the script tag and the element. The browser loads the data from AboutTheApp, so your server makes no API calls.
Can I render the About box data on the server instead?
Yes. The public API GET /abouts/:alias returns the same data as JSON, so you can load it in PHP and render your own markup. The Integrate panel shows the full API address for your product.
How do I show the version each customer runs?
Add the customer-alias attribute with the customer's alias from the dashboard. The box then shows the version of that customer's primary deployment. If you also set the version attribute, it takes precedence.
Ready to add your own About box?
Create a free AboutTheApp product and get your integration code right away.