Laravel AWS Personalize

A demo app to show how the implementation results look like when AWS Personalize is trained with movie lens dataset.

Source codes are available on github.com/guvener/laravel-aws-personalized-demo

Deployed at movies.figurava.com


Clone this repository and install dependencies.

git clone https://github.com/guvener/laravel-aws-personalized-demo.git
composer install
# optional valet link

Open installed folder and copy sample environment file .env.sample to .env and set up.

cp .env.sample .env
php artisan key:generate

Configure your database in the .env file and run migrate.

php artisan migrate

Download demo database dump and import.


Configuration file: config/personalize.php

    // App\Actions\Personalize/PersonalizeViewer needs following configurations filled to make AWS Personalize Requests
    'campaign_arn' => env('CAMPAIGN_ARN'),
    'aws_key' => env('AWS_ACCESS_KEY_ID'),
    'aws_secret' => env('AWS_SECRET_ACCESS_KEY'),
    'aws_region' => env('AWS_DEFAULT_REGION'),

    // App\Models\Link needs Open Movie Database API key filled to get movie metadata
    'omdb_key' => env('OMDB_KEY')

Models and Data

  • MySQL database dump can be downloaded on the movie data repository.
  • Default Laravel User and Jetstream tables are kept for later possible use cases.
  • movies, ratings, tags and links tables are exactly as movielens dataset ml-latest.zip.
  • viewers table is introduced for storing movielens dataset’s users (users table is reserved for Laravel).
  • viewers table has cached personalized movie recommendations to review personalized responses before training your own personalized model.

AWS hands-on lab movie recommendations lab

App is deployed to check results of personalize responses of the lab. Demo is not related to Amazon Web Services. Personalization results may differ according to your recipe settings. Demo is not a reference, it is intended to you save some time. Feel free to use as a starting point and try yourself.

Create real-time, personalized movie recommendations with Personalize hands on AWS Lab Link

MovieLens’ full dataset is used instead of small subset. Dataset contains 26 million ratings, 1.1 million tags, 58000 movies 1900 anonymous viewers.


In this demo SageMaker is trained with USER_PERSONALIZATION recipe, consider RELATED_ITEMS recipe for getting similar movies.