Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dev0ps's avatar

How to build AI in laravel

Hi guys is their any best plugin for laravel that support Ai

0 likes
8 replies
bashy's avatar

AI being? What do you want it to do?

Dev0ps's avatar

I want they identify user behaviour and store them in the database

Helmchen's avatar
public function addToCart($article)
{
    $user = Auth::user();

    if($article instanceof Apple)
    {
        MoreTrustedStorageThanFacebookUsesPlease::saveBehaviour($user->name.' from '.$user->country->name.' likes apples');
    }
}

just kidding

easiest solution would be to use something like Google Analytics or Piwik or any other analytics software out there.

1 like
Nash's avatar

Here's a machine learning library for PHP: https://github.com/php-ai/php-ml

You could also use something like Google's Prediction API

Generally speaking though, languages like Python, Java and C++ are more widely used for machine learning and AI, so you'll probably find more tutorials and help for those.

By the way, there's a Humble Bundle with AI ebooks and videos going on right now (4 days left at the time of this reply): https://www.humblebundle.com/books/artificial-intelligence-books

Dev0ps's avatar

@Helmchen thank you brother it's very helpful. I need a help imagine you are userA and I'm userB.

Now

A visits B profile A checks B photos A checks B videos A checks B About

Now to detect this behaviors.

Dev0ps's avatar

@Nash I already check this GitHub file but I am not able to use this because I don't know how to install this file to my laravel project and how to start working in these files

36864's avatar

What you described is simple activity tracking, it has nothing to do with AI.

2 likes
rawilk's avatar
rawilk
Best Answer
Level 47

@devops - It clearly states how to install it. Just run the following composer command:

composer require php-ai/php-ml

Please or to participate in this conversation.