Skip to content

Upgrade guide

Phil edited this page Oct 3, 2026 · 1 revision

LaraLocker 3 is a rewrite. The 1.0 and 2.0 branches and master could not be installed on Laravel 7 or later, so moving to 3 is mostly a matter of the requirements and the config below. The facade calls you already use still work.

1. Requirements

PHP 8.2+ and Laravel 12 or 13.

composer require ijeffro/laralocker:^3.0

2. Config

The .env names haven't changed. The config file is flat now, so if you published the old one, delete it and publish the new one:

rm config/laralocker.php
php artisan vendor:publish --tag=laralocker-config
Before 3.x
laralocker.learning-locker.api.url laralocker.url
laralocker.learning-locker.api.key laralocker.key
laralocker.learning-locker.api.secret laralocker.secret
laralocker.learning-locker.xapi_statements.actor_hompage laralocker.xapi.homepage

The laravel, database, export, queue and storage sections are gone.

3. Responses and errors

Before 3.x
methods returned a JSON string they return a decoded array
errors were returned as an exception object errors are thrown as LearningLockerException
// before
$stores = json_decode(LearningLocker::stores()->get());

// 3.x
$stores = LearningLocker::stores()->get();

4. Removed

Before 3.x
LearningLocker::routes() and the package's /laralocker/* routes removed. Call the facade from your own controllers.
php artisan laralocker:setup removed. Add the three .env values.
package migrations and models removed
Laralocker facade removed (it did nothing)
journeys(), journey(), journeyProgress() resource('journey', $id) and resource('journeyprogress', $id), Enterprise only
statement()->create($data) statements()->send($data), or the xAPI facade
persona($id)->identifier()->create($data) personaIdentifier()->create(['persona' => $id, 'ifi' => $ifi])
xAPI::...->store() send() (store() still works)

The service provider moved to Ijeffro\Laralocker\LaralockerServiceProvider. If you list it in bootstrap/providers.php or config/app.php, update it or rely on package discovery.

5. New

where(), sort(), select(), populate(), skip(), limit(), first(), count() and paginate() are new (see Querying), as are aggregate(), ping(), clientInfo(), connect(), personaImports(), personaIdentifiers()->upsert() and reading statements with xAPI::statements().

Clone this wiki locally