Skip to content

Upgrade Guide

Upgrading To 4.0 From 3.x

Estimated Upgrade Time: 15 Minutes

NOTE

LaraGram 4 is a largely additive release with minimal breaking changes to the bot layer. Most of the new work is in brand-new components (MTProto, Luna, the web layer). Bumping the dependency plus the steps below is usually all that is required.

PHP 8.3 Required

Likelihood Of Impact: High

LaraGram 4 requires PHP 8.3 – 8.5. Update your environment before upgrading.

Updating Dependencies

Likelihood Of Impact: High

In composer.json, set laraxgram/laragram to ^4.0 (and update any first-party packages to their 4.x releases), then run:

shell
composer update

Post-Upgrade Steps

Likelihood Of Impact: High

The new web layer needs a few directories and config files that did not exist in 3.x. Apply the ones relevant to your application:

1. Create the storage cache directories. Views and templates are compiled to storage/framework:

shell
mkdir -p storage/framework/{views,templates,sessions}

2. Enable web routing (if used). To serve HTTP routes, register them in bootstrap/app.php:

php
->withRouting(
    web: __DIR__.'/../routes/web.php',
    api: __DIR__.'/../routes/api.php',
)

3. Add the routes and resources folders as needed. Create only what you use — e.g. routes/web.php, resources/views, resources/css, resources/js.

4. Publish the new config files from vendor (for example session.php):

shell
php commander vendor:publish

5. Update the LaraGram installer so laragram new scaffolds 4.x projects:

shell
composer global require laraxgram/installer

Redirects Documentation

Likelihood Of Impact: Low

The standalone redirects page is merged into HTTP responses. Documentation change only — the helpers are unchanged.

Adopting New Features (Optional)

None of this is required to upgrade:

Released under the MIT License.