<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ehtesham Ali</title>
    <description>The latest articles on Forem by Ehtesham Ali (@ehtesham_ali_abc367f36a5b).</description>
    <link>https://forem.com/ehtesham_ali_abc367f36a5b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2447535%2Ff118933b-c885-46c9-9e07-c6da322ed602.png</url>
      <title>Forem: Ehtesham Ali</title>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ehtesham_ali_abc367f36a5b"/>
    <language>en</language>
    <item>
      <title>Discover Laravel Package Ocean: Your One-Stop Hub for Laravel Packages</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Tue, 11 Mar 2025 06:12:48 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/discover-laravel-package-ocean-your-one-stop-hub-for-laravel-packages-3h2d</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/discover-laravel-package-ocean-your-one-stop-hub-for-laravel-packages-3h2d</guid>
      <description>&lt;p&gt;Laravel is one of the most popular PHP frameworks, known for its elegance, simplicity, and developer-friendly ecosystem. A key strength of Laravel lies in its extensive package ecosystem, which allows developers to extend functionality and streamline development processes efficiently. But with thousands of Laravel packages available, finding the right one can be overwhelming. This is where &lt;a href="https://laravel-package-ocean.com/" rel="noopener noreferrer"&gt;Laravel Package Ocean&lt;/a&gt; comes in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Laravel Package Ocean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Package Ocean is a curated platform designed to help the Laravel community discover new and useful packages all in one place. Whether you're looking for authentication solutions, debugging tools, or UI components, this platform simplifies the search process by categorizing and listing high-quality Laravel packages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmak19q7app3bedrluql.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmak19q7app3bedrluql.png" alt="Packages" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Laravel Package Ocean?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Centralized Resource:&lt;/strong&gt; Instead of scouring GitHub or Packagist, Laravel Package Ocean brings the best packages together in a single, easy-to-navigate platform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Well-Organized Categories:&lt;/strong&gt; With 18 well-defined categories, finding packages suited to your project needs is effortless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active Community:&lt;/strong&gt; With 578 packages, 362 authors, and growing, this platform thrives on community contributions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time-Saving:&lt;/strong&gt; Instead of manually researching, developers can quickly browse and compare packages to implement the best solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fytir47tphed8cuq1lmwf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fytir47tphed8cuq1lmwf.png" alt="Top Packages" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exploring Key Laravel Package Categories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File Management (19 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Handle file uploads, cloud storage integrations, and media handling with ease. Example: Spatie's Media Library.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auth &amp;amp; Permissions (32 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Secure your Laravel applications with authentication, role-based access control, and user management solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database &amp;amp; Eloquent (109 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enhance your database interactions with ORM enhancements, migrations, and query-building tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debugging &amp;amp; Dev Tools (38 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Optimize debugging with tools like Laravel Debugbar and Telescope to monitor and improve performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevOps (22 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automate deployments, monitor applications, and manage cloud infrastructure efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Localization (20 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Easily translate your Laravel applications with multi-language support packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API (29 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Build powerful APIs with packages that simplify RESTful and GraphQL API development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SEO (5 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Optimize your Laravel applications for search engines with metadata management tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing (9 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Improve code reliability with PHPUnit, Pest, and other Laravel-specific testing utilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Payment (3 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Integrate payment gateways like Stripe and PayPal for seamless transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security (20 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enhance security with packages that handle encryption, authentication, and vulnerability protection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mail (12 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Manage email templates, transactional emails, and SMTP integrations effortlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;E-Commerce (6 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Develop online stores with Laravel-specific e-commerce solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CMS &amp;amp; Admin Panels (16 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Quickly build content management systems and admin dashboards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Architecture (31 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Improve application structure with patterns, SOLID principles, and clean code practices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notifications (14 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enhance user engagement with email, SMS, and push notifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UI &amp;amp; Blade Components (32 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enhance frontend development with reusable Blade components and UI frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Utilities &amp;amp; Helpers (161 Packages)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Find general-purpose Laravel packages that simplify various development tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Package Ocean is a must-visit resource for any Laravel developer. By offering a categorized directory of top-notch Laravel packages, it significantly reduces the time spent searching for the right tools. Whether you're a beginner or an experienced developer, this platform can help you find, compare, and integrate packages effortlessly into your projects.&lt;/p&gt;

&lt;p&gt;Check it out today at Laravel Package Ocean and explore the vast ocean of Laravel packages!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>What REALLY Happens When You Type Localhost?</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Thu, 27 Feb 2025 14:48:00 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/what-really-happens-when-you-type-localhost-1opm</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/what-really-happens-when-you-type-localhost-1opm</guid>
      <description>&lt;p&gt;If you’ve ever built a website, worked with web servers, or even dabbled in web development, you’ve probably typed localhost into your browser’s address bar. But have you ever stopped to think — what actually happens when you type localhost and hit enter?&lt;/p&gt;

&lt;p&gt;It might look like magic, but behind the scenes, your operating system, browser, and network stack are performing a series of critical steps to translate that one word into a working page. Let’s break down the journey, step by step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6iya02vr063thx7qs56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6iya02vr063thx7qs56.png" alt="localhost" width="700" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: What is localhost?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;localhost is essentially a nickname for your own computer. Instead of typing your computer’s actual IP address, like 127.0.0.1, you can just type localhost.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;localhost = Home sweet home.&lt;/li&gt;
&lt;li&gt;It always refers to the loopback interface, meaning traffic stays entirely inside your computer.&lt;/li&gt;
&lt;li&gt;This is why localhost works even without an internet connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: DNS — Wait, Is Localhost a Domain?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Normally, when you type a domain like google.com, your system has to ask a DNS server (Domain Name System) to translate that human-readable name into an IP address.&lt;/p&gt;

&lt;p&gt;But &lt;em&gt;localhost&lt;/em&gt; is special.&lt;/p&gt;

&lt;p&gt;Your computer doesn’t bother asking a DNS server.&lt;br&gt;
Instead, it checks a special file called the hosts file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx6zs2t1bs95qf37i4rv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx6zs2t1bs95qf37i4rv.jpg" alt="meme-1" width="200" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔎 &lt;strong&gt;The Hosts File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On Windows, it’s located at:&lt;br&gt;
&lt;em&gt;C:\Windows\System32\drivers\etc\hosts&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On Linux/macOS, it’s at:&lt;br&gt;
&lt;em&gt;/etc/hosts&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This file contains an entry like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;127.0.0.1    localhost&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This tells your computer:&lt;br&gt;
👉 "localhost is just another way of saying 127.0.0.1."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnoj58jl6oes2q8kv2alm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnoj58jl6oes2q8kv2alm.png" alt="Use of Localhost" width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: The Loopback Interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that your computer knows localhost is 127.0.0.1, it sends the request to itself — but it doesn’t leave the computer or touch your external network card.&lt;/p&gt;

&lt;p&gt;Instead, the request travels through a special &lt;strong&gt;virtual network interface&lt;/strong&gt; called the &lt;strong&gt;loopback interface&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This is a software-only interface.&lt;/li&gt;
&lt;li&gt;No external router, switch, or ISP gets involved.&lt;/li&gt;
&lt;li&gt;It’s the fastest possible network request since it never leaves your device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Your Web Server Responds&lt;/strong&gt;&lt;br&gt;
Now that the request lands at 127.0.0.1, your web server — often something like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apache (XAMPP)&lt;/li&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Laravel’s Artisan Serve&lt;/li&gt;
&lt;li&gt;Node.js Express Server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...gets the request and prepares a response.&lt;/p&gt;

&lt;p&gt;The server does the usual work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Route matching (What page is requested? /, /about, etc.)&lt;/li&gt;
&lt;li&gt;Executing any back-end logic (database queries, etc.)&lt;/li&gt;
&lt;li&gt;Returning HTML (or JSON, etc.) to the browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Your Browser Renders the Response&lt;/strong&gt;&lt;br&gt;
Once the web server responds, your browser takes over:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parses the HTML, CSS, and JavaScript.&lt;/li&gt;
&lt;li&gt;Renders the page.&lt;/li&gt;
&lt;li&gt;You see the final page on &lt;a href="http://localhost" rel="noopener noreferrer"&gt;http://localhost&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Use Localhost?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development:&lt;/strong&gt; You can build and test websites locally before deploying them live.&lt;br&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; It’s faster than any external connection.&lt;br&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; No one else can see what you’re working on.&lt;br&gt;
&lt;strong&gt;Offline Work:&lt;/strong&gt; No internet needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakysasb2mtrjnazm9q3m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakysasb2mtrjnazm9q3m.jpg" alt="localhost == home" width="728" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Localhost Ports&lt;/strong&gt;&lt;br&gt;
Sometimes, you’ll see URLs like:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That :8000 is a port number. Common ports include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PORT&lt;/strong&gt;    &lt;strong&gt;Common Use&lt;/strong&gt;&lt;br&gt;
80  Default for HTTP&lt;br&gt;
443 Default for HTTPS&lt;br&gt;
3306    MySQL Database&lt;br&gt;
8000    Laravel (Artisan Serve)&lt;br&gt;
8080    Generic Web Servers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What If Localhost Doesn’t Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you type localhost and nothing happens, a few things could be wrong:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No server is running.&lt;/em&gt;&lt;br&gt;
Your computer will happily send a request to 127.0.0.1, but if no server is listening, you’ll get a "Connection Refused" error.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Firewall Issues.&lt;/em&gt;&lt;br&gt;
Sometimes security software might block local ports.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hosts File Misconfiguration.&lt;/em&gt;&lt;br&gt;
If the hosts file doesn’t have localhost correctly mapped to 127.0.0.1, things break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Recap — Full Journey&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You type localhost.&lt;/li&gt;
&lt;li&gt;OS checks hosts file — finds 127.0.0.1.&lt;/li&gt;
&lt;li&gt;Request is sent to loopback interface.&lt;/li&gt;
&lt;li&gt;Local web server (like Apache, Nginx, or Laravel) handles request.&lt;/li&gt;
&lt;li&gt;Response is sent back to browser.&lt;/li&gt;
&lt;li&gt;Browser renders the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdw9tm1aoc7l5pz9hipm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdw9tm1aoc7l5pz9hipm.jpg" alt="works on my computer-meme" width="215" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;localhost is a simple term that triggers a sophisticated set of actions under the hood. Understanding what really happens helps developers troubleshoot better, set up environments correctly, and appreciate how beautifully networks (even internal ones) operate.&lt;/p&gt;

&lt;p&gt;So next time you type localhost, remember — it’s not just "your computer." It’s a carefully coordinated ballet between your OS, network stack, web server, and browser. &lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>webdev</category>
      <category>linux</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Best Websites to Find Laravel Templates for Your Projects</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Wed, 26 Feb 2025 04:49:04 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/best-websites-to-find-laravel-templates-for-your-projects-4e1b</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/best-websites-to-find-laravel-templates-for-your-projects-4e1b</guid>
      <description>&lt;p&gt;When working on a Laravel project, starting with a high-quality template can save you time and effort. Whether you need an admin dashboard, a front-end theme, or a ready-to-use eCommerce solution, Laravel templates can help streamline development.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll explore some of the best websites where you can find Laravel templates, both free and premium.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;a href="https://adminlte.io/" rel="noopener noreferrer"&gt;AdminLTE&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AdminLTE is a popular open-source admin dashboard template built on Bootstrap. It provides a Laravel integration package, making it easy to set up with Laravel projects. It comes with a variety of UI components, widgets, and a responsive design.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free and open-source&lt;/li&gt;
&lt;li&gt;Responsive and mobile-friendly&lt;/li&gt;
&lt;li&gt;Extensive UI components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;a href="https://coreui.io/" rel="noopener noreferrer"&gt;CoreUI&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CoreUI is another excellent admin dashboard template that provides seamless Laravel integration. It comes with a free and premium version and supports multiple frameworks.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lightweight and fast&lt;/li&gt;
&lt;li&gt;Laravel, Vue, React, and Angular support&lt;/li&gt;
&lt;li&gt;Free version available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;a href="https://themeforest.net/" rel="noopener noreferrer"&gt;ThemeForest&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ThemeForest is a marketplace offering a wide selection of premium Laravel templates for various use cases, including admin panels, eCommerce, and SaaS applications.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Professionally designed templates&lt;/li&gt;
&lt;li&gt;Regular updates and support&lt;/li&gt;
&lt;li&gt;Wide variety of options&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. &lt;a href="https://www.creative-tim.com/templates/laravel-free" rel="noopener noreferrer"&gt;Creative Tim&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creative Tim offers premium UI kits and templates for Laravel. Their Laravel dashboards and UI kits are well-designed and optimized for developers.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Beautiful UI components&lt;/li&gt;
&lt;li&gt;Free and premium templates&lt;/li&gt;
&lt;li&gt;Laravel and Bootstrap integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. &lt;a href="https://voyager.devdojo.com/" rel="noopener noreferrer"&gt;Laravel Voyager&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Voyager is a Laravel-based admin panel that helps manage your Laravel application with ease. It includes features like media management, CRUD builder, and role-based authentication.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built-in admin panel&lt;/li&gt;
&lt;li&gt;Media manager&lt;/li&gt;
&lt;li&gt;User authentication system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. &lt;a href="https://uideck.com/" rel="noopener noreferrer"&gt;UIdeck&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;UIdeck offers free and premium Bootstrap templates, some of which are built specifically for Laravel. It provides clean and modern designs for various project types.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free Laravel templates&lt;/li&gt;
&lt;li&gt;Well-structured code&lt;/li&gt;
&lt;li&gt;Modern UI components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. &lt;a href="https://wrapbootstrap.com/" rel="noopener noreferrer"&gt;WrapBootstrap&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WrapBootstrap is another marketplace for Bootstrap-based templates, including Laravel-powered admin dashboards and UI kits.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-quality premium themes&lt;/li&gt;
&lt;li&gt;Laravel-ready dashboards&lt;/li&gt;
&lt;li&gt;Mobile-responsive templates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8. &lt;a href="https://www.bootstrapdash.com/" rel="noopener noreferrer"&gt;BootstrapDash&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;BootstrapDash offers well-designed admin dashboard templates with Laravel support, ideal for creating custom admin panels.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Laravel and Bootstrap integration&lt;/li&gt;
&lt;li&gt;Developer-friendly code&lt;/li&gt;
&lt;li&gt;Free and paid options&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using pre-designed Laravel templates can significantly boost your development speed and enhance the visual appeal of your projects. Whether you need a free or premium solution, the websites mentioned above provide excellent options to get started quickly.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Laravel News: Laravel 12 Released</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Tue, 25 Feb 2025 06:17:32 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/laravel-news-laravel-12-released-2hb1</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/laravel-news-laravel-12-released-2hb1</guid>
      <description>&lt;p&gt;Laravel 12 is now officially released, bringing a fresh set of enhancements while primarily focusing on stability, maintenance, and updating upstream dependencies. This release ensures minimal breaking changes, making the upgrade process smooth for most applications. 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzq2bx2h42613xdwgj5a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzq2bx2h42613xdwgj5a.jpg" alt="laravel" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s New in Laravel 12?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. New Starter Kits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest highlights of Laravel 12 is the introduction of brand-new starter kits for React, Vue, and Livewire. These starter kits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ShadCN UI components for a modern UI experience.&lt;/li&gt;
&lt;li&gt;Livewire stack with Flux components (including a free version).&lt;/li&gt;
&lt;li&gt;WorkOS AuthKit variants offering:

&lt;ul&gt;
&lt;li&gt;Social authentication&lt;/li&gt;
&lt;li&gt;  Passkey authentication&lt;/li&gt;
&lt;li&gt;  Email-based authentication&lt;/li&gt;
&lt;li&gt;  Single Sign-On (SSO) with WorkOS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;For developers looking to build applications with streamlined authentication and modern UI components, these starter kits provide an excellent starting point. You can explore the documentation for setup and usage details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Focus on Maintenance &amp;amp; Stability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel 12 is primarily a maintenance-focused release, meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upstream dependencies are updated to keep the framework secure and performant.&lt;/li&gt;
&lt;li&gt;Minimal breaking changes make the upgrade process smooth.&lt;/li&gt;
&lt;li&gt;Ongoing feature releases will continue throughout the year without breaking changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since Laravel is widely used in production applications, this approach ensures long-term reliability without disrupting existing projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. PHP 8.2+ Minimum Requirement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel 12 continues to require PHP 8.2 as the minimum version. This aligns with modern PHP improvements and ensures better performance and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Install Laravel 12&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re setting up a new Laravel project, install the latest Laravel installer using Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer global require laravel/installer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, create a new Laravel 12 project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;laravel new projectname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're using &lt;a href="https://herd.laravel.com/windows" rel="noopener noreferrer"&gt;Laravel Herd&lt;/a&gt;, simply update to the latest version to get the new installer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upgrading to Laravel 12&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For existing applications, the easiest way to upgrade is by using &lt;a href="https://laravelshift.com/" rel="noopener noreferrer"&gt;Laravel Shift&lt;/a&gt;, a tool that automates the upgrade process. Alternatively, you can follow the official Laravel Upgrade Guide to manually update your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel 12 is all about stability, long-term support, and ease of upgrades. With new starter kits for React, Vue, and Livewire, updated dependencies, and continued improvements rolling out over the year, Laravel remains a top choice for modern web application development.&lt;/p&gt;

&lt;p&gt;Upgrade today and take advantage of Laravel’s latest enhancements! 🚀&lt;/p&gt;

</description>
      <category>news</category>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why RabbitMQ? A Developer-Friendly Guide to Event-Driven Architecture</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Tue, 25 Feb 2025 06:07:00 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/why-rabbitmq-a-developer-friendly-guide-to-event-driven-architecture-i1n</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/why-rabbitmq-a-developer-friendly-guide-to-event-driven-architecture-i1n</guid>
      <description>&lt;p&gt;In modern applications, handling real-time data, distributed systems, and asynchronous communication is crucial for scalability and efficiency. RabbitMQ, a message broker, enables event-driven architecture (EDA) by decoupling services, ensuring reliable message delivery, and improving system resilience. This guide explores RabbitMQ’s role in EDA and why developers should consider it over alternatives like Apache Kafka.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6twp5yd9mwwmoq15hwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6twp5yd9mwwmoq15hwx.png" alt="Rabbit MQ" width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is RabbitMQ?&lt;/strong&gt;&lt;br&gt;
RabbitMQ is an open-source message broker that implements the Advanced Message Queuing Protocol (AMQP). It is designed to route, store, and forward messages between producers and consumers, supporting multiple messaging patterns like pub-sub, request-response, and work queues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Choose RabbitMQ for Event-Driven Architecture?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ease of Use and Quick Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ is simple to install and configure, making it a great choice for small to medium-sized projects requiring message-based communication. Its web-based management UI allows developers to monitor queues, exchanges, and messages easily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexible Messaging Patterns&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Work Queues:&lt;/strong&gt; Distributes tasks among multiple workers for parallel processing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pub-Sub Model:&lt;/strong&gt; Enables event broadcasting to multiple consumers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Routing and Topic Exchanges:&lt;/strong&gt; Allows complex routing logic based on message content.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reliable Message Delivery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ ensures message durability with acknowledgments, persistent queues, and dead-letter exchanges to prevent message loss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Language Agnostic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Supports multiple programming languages, including PHP, JavaScript, Python, Go, and Java, making it ideal for polyglot microservices architectures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lightweight and Efficient&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ is optimized for low-latency messaging and can be deployed in cloud environments, on-premises, or even on edge devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction and Acknowledgment Support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike Kafka, which primarily focuses on high-throughput event streaming, RabbitMQ offers transaction support and manual message acknowledgments, ensuring message integrity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integration with DevOps Tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ integrates well with Kubernetes, Prometheus, Grafana, and cloud services like AWS SQS, making it a solid choice for cloud-native applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faor6dvzvvaxdr4n0c788.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faor6dvzvvaxdr4n0c788.png" alt="Rabbit MQ Working" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RabbitMQ vs. Kafka: Which One Should You Use?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature : Messaging Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ: Message queue (AMQP)&lt;br&gt;
Kafka: Event streaming (log-based)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature : Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ: Task distribution, microservices communication&lt;br&gt;
Kafka: Real-time analytics, event sourcing&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature : Performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ: Low latency, moderate throughput&lt;br&gt;
Kafka: High throughput, event-driven processing&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature : Ordering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ: FIFO queues, manual acknowledgment&lt;br&gt;
Kafka: Partition-based ordering&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature : Persistence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ: FIFO queues, manual acknowledgment&lt;br&gt;
Kafka: Partition-based ordering&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9b8r59ordquwcwjtm0ds.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9b8r59ordquwcwjtm0ds.gif" alt="Rabbit MQ Vs Kafka" width="800" height="1111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use RabbitMQ:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need traditional message queuing with acknowledgments and retry mechanisms.&lt;/li&gt;
&lt;li&gt;Your system requires complex routing using fanout, topic, or direct exchanges.&lt;/li&gt;
&lt;li&gt;You prioritize message reliability over high-throughput event streaming.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqb9bkofje18dvi5icf8c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqb9bkofje18dvi5icf8c.png" alt="Kafka vs Rabbit MQ" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use Kafka:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need high-throughput event streaming for real-time analytics.&lt;/li&gt;
&lt;li&gt;Your system relies on log-based event replay for state reconstruction.&lt;/li&gt;
&lt;li&gt;You require long-term storage and partitioning for scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaqp941vvkfploey7lve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaqp941vvkfploey7lve.png" alt="Kafka vs Rabbit MQ" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
RabbitMQ is an excellent choice for developers building event-driven architectures that require reliable messaging, flexible routing, and ease of integration with various programming languages. While Kafka is suited for event streaming at scale, RabbitMQ remains a preferred choice for traditional messaging queues, microservices, and task distribution.&lt;/p&gt;

</description>
      <category>eventdriven</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>devops</category>
    </item>
    <item>
      <title>History of Laravel: How Laravel Started and Where It Stands Today</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Mon, 24 Feb 2025 05:00:00 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/history-of-laravel-how-laravel-started-and-where-it-stands-today-236n</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/history-of-laravel-how-laravel-started-and-where-it-stands-today-236n</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel is a modern PHP framework designed to simplify web development by providing elegant syntax, powerful tools, and a developer-friendly experience. It was created by Taylor Otwell in 2011 with the goal of improving PHP development, offering an alternative to the then-popular CodeIgniter framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Early Development of Laravel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtskv45cc2mr5akaqdtx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtskv45cc2mr5akaqdtx.png" alt="Laravel Old Version-1" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before Laravel, PHP frameworks like CodeIgniter were widely used but lacked advanced features such as built-in authentication, routing, and dependency injection. Taylor Otwell set out to build a framework that addressed these shortcomings while maintaining simplicity and flexibility.&lt;/p&gt;

&lt;p&gt;Laravel 1.0 was released in June 2011, offering features like routing, models, views, and sessions. However, it lacked controllers, making it more of a micro-framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Growth and Popularity of Laravel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With each version, Laravel introduced new features that set it apart from other PHP frameworks. Some of the key milestones in Laravel's growth include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 2.0 (November 2011):&lt;/strong&gt; Introduced controllers, making it a full MVC framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 3.0 (February 2012):&lt;/strong&gt; Added migrations, Artisan CLI, and support for database seeding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 4.0 (May 2013):&lt;/strong&gt; A complete rewrite, introducing Composer-based package management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 5.0 (February 2015):&lt;/strong&gt; Introduced job queues, event broadcasting, and service providers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 6.0 (September 2019):&lt;/strong&gt; Moved to semantic versioning, improving stability and updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 7.0 (March 2020):&lt;/strong&gt; Introduced Laravel Airlock (now Sanctum) for API authentication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 8.0 (September 2020):&lt;/strong&gt; Added Laravel Jetstream for authentication scaffolding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 9.0 (February 2022):&lt;/strong&gt; Shifted to an annual release cycle and improved performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel 10.0 (February 2023):&lt;/strong&gt; Introduced new features like native type declarations and process handling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Major Laravel Versions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Version: 1.0&lt;/p&gt;

&lt;p&gt;Release Date: June 2011&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basic routing, sessions, views, and models&lt;/p&gt;

&lt;p&gt;Version: 2.0&lt;/p&gt;

&lt;p&gt;Release Date: November 2011&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Introduced controllers, making it an MVC framework&lt;/p&gt;

&lt;p&gt;Version: 3.0&lt;/p&gt;

&lt;p&gt;Release Date: February 2012&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Introduced Artisan CLI, migrations, and database seeding&lt;/p&gt;

&lt;p&gt;Version: 4.0&lt;/p&gt;

&lt;p&gt;Release Date: May 2013&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rebuilt on Composer for package management&lt;/p&gt;

&lt;p&gt;Version: 5.0&lt;/p&gt;

&lt;p&gt;Release Date: February 2015&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Introduced job queues, event broadcasting, and middleware&lt;/p&gt;

&lt;p&gt;Version: 6.0&lt;/p&gt;

&lt;p&gt;Release Date: September 2019&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moved to semantic versioning, Laravel Vapor support&lt;/p&gt;

&lt;p&gt;Version: 7.0&lt;/p&gt;

&lt;p&gt;Release Date: March 2020&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Sanctum for API authentication, blade component tags&lt;/p&gt;

&lt;p&gt;Version: 8.0&lt;/p&gt;

&lt;p&gt;Release Date: September 2020&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Jetstream, job batching, and dynamic factories&lt;/p&gt;

&lt;p&gt;Version: 9.0&lt;/p&gt;

&lt;p&gt;Release Date: February 2022&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PHP 8.0 requirement, Symfony Mailer, improved Eloquent performance&lt;/p&gt;

&lt;p&gt;Version: 10.0&lt;/p&gt;

&lt;p&gt;Release Date: February 2023&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notable Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Process handling, native type declarations, security updates&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Today&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel has grown into one of the most popular PHP frameworks, widely used for developing scalable and maintainable web applications. Its ecosystem includes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eloquent ORM:&lt;/strong&gt; A powerful Active Record implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blade Template Engine:&lt;/strong&gt; A simple yet powerful templating engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Sanctum &amp;amp; Passport:&lt;/strong&gt; API authentication solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Livewire:&lt;/strong&gt; Enables reactive components without writing JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Breeze &amp;amp; Jetstream:&lt;/strong&gt; Authentication scaffolding for modern applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Forge &amp;amp; Envoyer:&lt;/strong&gt; Tools for server management and deployment.&lt;/p&gt;

&lt;p&gt;Laravel continues to thrive with a strong community, frequent updates, and robust features, making PHP development easier and more efficient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From its humble beginnings in 2011 to becoming the leading PHP framework today, Laravel has transformed web development with its expressive syntax, developer-friendly tools, and continuous innovation. It remains the go-to framework for building modern web applications, and its future looks promising with ongoing improvements and a dedicated community.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Personalized Recommendation System with Laravel &amp; LLMs</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Fri, 21 Feb 2025 07:09:00 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/personalized-recommendation-system-with-laravel-llms-5b2j</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/personalized-recommendation-system-with-laravel-llms-5b2j</guid>
      <description>&lt;p&gt;A Personalized Recommendation System using Laravel &amp;amp; Large Language Models (LLMs) can be implemented to deliver user-specific content, product recommendations, or services based on preferences, interactions, and behaviors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of the System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Personalized Recommendation System in Laravel utilizes machine learning models, particularly LLMs, to analyze user interactions and provide tailored recommendations. The system involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Collection&lt;/strong&gt; – Gathering user interactions, purchases, likes, and behaviors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preprocessing &amp;amp; Feature Engineering&lt;/strong&gt; – Structuring data for LLM-based predictions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recommendation Algorithm&lt;/strong&gt; – Using LLMs &amp;amp; Collaborative Filtering to generate recommendations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Integration&lt;/strong&gt; – Laravel serves as the backend, integrating LLM APIs for AI-driven recommendations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Display&lt;/strong&gt; – Laravel Blade or Vue.js renders personalized content dynamically.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Laravel (PHP 8+, Laravel 10)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; MySQL/PostgreSQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM Integration:&lt;/strong&gt; OpenAI API, Hugging Face Models, Local LLMs (Llama, Mistral, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector Search:&lt;/strong&gt; Pinecone, Weaviate, or FAISS for semantic search&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Vue.js/React with Laravel Blade&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation Steps&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Collection &amp;amp; Storage
Store user preferences, clicks, and history in a Laravel database:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Migration for user_preferences table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'user_preferences'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Blueprint&lt;/span&gt; &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;foreignId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'user_id'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;constrained&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;onDelete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'cascade'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'preferences'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Store categories, interests, etc.&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Model for User Preferences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserPreference&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$fillable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'user_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'preferences'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$casts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'preferences'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'array'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Integrating LLM APIs for Recommendation&lt;/strong&gt;&lt;br&gt;
To generate recommendations, you can integrate OpenAI GPT-4, Mistral, or a custom fine-tuned LLM.&lt;/p&gt;

&lt;p&gt;Laravel Service to Call OpenAI API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RecommendationService&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getRecommendations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userPreferences&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'OPENAI_API_KEY'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

        &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'model'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'gpt-4-turbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'prompt'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"Based on the user's preferences: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userPreferences&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; 
                        &lt;span class="s2"&gt;", recommend 5 products/services that they might like."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'max_tokens'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'choices'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Implementing a Recommendation API in Laravel&lt;/strong&gt;&lt;br&gt;
Expose recommendations via a Laravel API.&lt;/p&gt;

&lt;p&gt;Controller to Fetch Personalized Recommendations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\UserPreference&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Services\RecommendationService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RecommendationController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$recommendationService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;RecommendationService&lt;/span&gt; &lt;span class="nv"&gt;$recommendationService&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;recommendationService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$recommendationService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getRecommendations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$preferences&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;UserPreference&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'user_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$preferences&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'No preferences found'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="nv"&gt;$recommendations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;recommendationService&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getRecommendations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$preferences&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;preferences&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$recommendations&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;API Route&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('/recommendations/{userId}', [RecommendationController::class, 'getRecommendations']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Using Vector Databases for Semantic Search&lt;/strong&gt;&lt;br&gt;
To enhance recommendations, you can use FAISS (Facebook AI Similarity Search) or Pinecone to store and retrieve embeddings.&lt;/p&gt;

&lt;p&gt;Generating Embeddings for Products&lt;br&gt;
Use OpenAI’s text-embedding-ada-002 model to convert product descriptions into vectors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmbeddingService&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;generateEmbedding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'OPENAI_API_KEY'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

        &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;embeddings&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'model'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'text-embedding-ada-002'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'input'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'data'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Store these embeddings in a database or Pinecone to match user preferences efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Frontend Integration in Laravel&lt;/strong&gt;&lt;br&gt;
Display recommendations dynamically using Laravel Blade or Vue.js.&lt;/p&gt;

&lt;p&gt;Blade View Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@foreach ($recommendations as $recommendation)
    &amp;lt;div class="recommendation-item"&amp;gt;
        &amp;lt;h3&amp;gt;{{ $recommendation['title'] }}&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;{{ $recommendation['description'] }}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
@endforeach
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Enhancements &amp;amp; Next Steps&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fine-tune LLMs&lt;/strong&gt; – Train custom models on user behavior data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Recommendation Model&lt;/strong&gt; – Combine LLMs with traditional collaborative filtering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Recommendations&lt;/strong&gt; – Implement WebSockets for live user feedback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A/B Testing&lt;/strong&gt; – Compare LLM-based recommendations vs. traditional approaches.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>How to Build a Vector Database with SQLite in laravel for LLM's</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Wed, 19 Feb 2025 07:02:05 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-build-a-vector-database-with-sqlite-in-laravel-for-llms-in-windows-59g0</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-build-a-vector-database-with-sqlite-in-laravel-for-llms-in-windows-59g0</guid>
      <description>&lt;p&gt;Building a Vector Database with SQLite in Laravel for LLMs on Windows requires configuring SQLite with vector support (via sqlite-vss or pgvector alternative), integrating it with Laravel, and using it for vector search. Here’s a step-by-step guide:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install SQLite with Vector Support&lt;/strong&gt;&lt;br&gt;
SQLite doesn’t natively support vector storage, but you can enable it using the &lt;a href="https://github.com/asg017/sqlite-vss" rel="noopener noreferrer"&gt;sqlite-vss&lt;/a&gt; extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.1 Download SQLite with Vector Support&lt;/strong&gt;&lt;br&gt;
Download the latest SQLite3 binary from SQLite’s official site.&lt;br&gt;
Download the sqlite-vss extension from &lt;a href="https://github.com/asg017/sqlite-vss/releases" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2 Enable the sqlite-vss Extension&lt;/strong&gt;&lt;br&gt;
Place sqlite-vss.dll (Windows) or .so (Linux/macOS) in your project directory.&lt;br&gt;
Load the extension in Laravel by modifying your database configuration.&lt;/p&gt;

&lt;p&gt;Step 2: Configure Laravel to Use SQLite&lt;br&gt;
Open the .env file and set up SQLite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=sqlite
DB_DATABASE=database/database.sqlite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the SQLite database file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;database
&lt;span class="nb"&gt;touch &lt;/span&gt;database/database.sqlite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure config/database.php has SQLite configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="s1"&gt;'sqlite'&lt;/span&gt; =&amp;gt; [
    &lt;span class="s1"&gt;'driver'&lt;/span&gt; =&amp;gt; &lt;span class="s1"&gt;'sqlite'&lt;/span&gt;,
    &lt;span class="s1"&gt;'database'&lt;/span&gt; =&amp;gt; &lt;span class="n"&gt;env&lt;/span&gt;(&lt;span class="s1"&gt;'DB_DATABASE'&lt;/span&gt;, &lt;span class="n"&gt;database_path&lt;/span&gt;(&lt;span class="s1"&gt;'database.sqlite'&lt;/span&gt;)),
    &lt;span class="s1"&gt;'prefix'&lt;/span&gt; =&amp;gt; &lt;span class="s1"&gt;''&lt;/span&gt;,
    &lt;span class="s1"&gt;'foreign_key_constraints'&lt;/span&gt; =&amp;gt; &lt;span class="n"&gt;true&lt;/span&gt;,
],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Migration for Vector Storage&lt;/strong&gt;&lt;br&gt;
Create a migration for storing vector embeddings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;migration&lt;/span&gt; &lt;span class="n"&gt;create_embeddings_table&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit the migration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Migrations\Migration&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Schema\Blueprint&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="no"&gt;Illuminate\Support\Facades\DB&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Schema&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CreateEmbeddingsTable&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'embeddings'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Blueprint&lt;/span&gt; &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Store vector as JSON&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="c1"&gt;// Load the SQLite extension&lt;/span&gt;
        &lt;span class="no"&gt;DB&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT load_extension('sqlite-vss')"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Create a vector index for fast search&lt;/span&gt;
        &lt;span class="no"&gt;DB&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CREATE VIRTUAL TABLE vss_index USING vss(embedding(1536))"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Example: OpenAI embedding size 1536&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;down&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;dropIfExists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'embeddings'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Insert and Query Vector Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;4.1 Insert Vector Data&lt;/p&gt;

&lt;p&gt;Modify Embedding.php model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Embedding&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$fillable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$casts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'embedding'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'array'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="c1"&gt;// Convert JSON to array&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Store embeddings in Laravel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\Embedding&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Embedding&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'text'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Hello world'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'embedding'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;...&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// Example vector&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Perform Vector Search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To perform a similarity search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="no"&gt;Illuminate\Support\Facades\DB&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$vector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;...&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// Example query vector&lt;/span&gt;

&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;DB&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT text, vss_distance(embedding, ?) as distance FROM embeddings ORDER BY distance LIMIT 5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$vector&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus: Generate Vectors using OpenAI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're working with LLM embeddings (like OpenAI), install openai-php:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require openai-php/client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, generate embeddings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;OpenAI\Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'your-openai-api-key'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;embeddings&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'model'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'text-embedding-ada-002'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'input'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Hello world'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="nv"&gt;$embedding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="s1"&gt;'data'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nc"&gt;Embedding&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'text'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Hello world'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'embedding'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$embedding&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Now you have a working Vector Database in SQLite inside Laravel, supporting vector storage and similarity search—ideal for LLM applications like retrieval-augmented generation (RAG).&lt;/p&gt;

</description>
      <category>llm</category>
      <category>laravel</category>
      <category>php</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Feb Art Challenge</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Thu, 13 Feb 2025 07:53:50 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/feb-art-challenge-5e9i</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/feb-art-challenge-5e9i</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/frontend-2025-02-12"&gt;Frontend Challenge - February Edition, CSS Art: February&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;For February, I wanted to capture the essence of love and winter. The heart symbolizes love, while the falling snowflakes represent the winter season. I aimed to create a visually appealing scene that evokes feelings of warmth and affection amidst the cold.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;You can view the full code and interact with the artwork here: &lt;a href="https://codepen.io/Ehtesham-Ali-the-typescripter/pen/XJWJRyw" rel="noopener noreferrer"&gt;CodePen&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;Creating this piece was a delightful experience! I wanted to focus on the heart as a symbol of love while incorporating the winter theme with falling snowflakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;: I improved my skills in CSS animations and how to create visually appealing effects using keyframes.&lt;br&gt;
&lt;strong&gt;Proud of&lt;/strong&gt;: The pulsing effect of the heart and the overall composition of the scene.&lt;br&gt;
&lt;strong&gt;Next steps&lt;/strong&gt;: I hope to explore more complex animations and perhaps add interactivity to the scene in future projects.&lt;br&gt;
Thank you for the opportunity to participate!&lt;/p&gt;

</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>How to Earn with SaaS Using DeepSeek: Unlocking New Revenue Streams</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Tue, 04 Feb 2025 06:20:00 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-earn-with-saas-using-deepseek-unlocking-new-revenue-streams-o3c</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-earn-with-saas-using-deepseek-unlocking-new-revenue-streams-o3c</guid>
      <description>&lt;p&gt;The Software-as-a-Service (SaaS) industry has revolutionized the way businesses operate, offering scalable, subscription-based solutions that cater to a wide range of needs. With the rise of AI and machine learning, platforms like DeepSeek are enabling entrepreneurs and businesses to create innovative SaaS products that generate consistent revenue. In this blog, we’ll explore how you can leverage DeepSeek to build and monetize SaaS solutions, along with three practical examples to inspire your next venture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1kiklh2xwtsve2f45gp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1kiklh2xwtsve2f45gp.png" alt="saas" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is DeepSeek?
&lt;/h3&gt;

&lt;p&gt;DeepSeek is an advanced AI platform that provides tools for natural language processing, data analysis, and automation. It empowers developers and businesses to create intelligent SaaS applications that solve real-world problems. By integrating DeepSeek’s capabilities, you can build AI-driven solutions that stand out in the competitive SaaS market.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Earn with SaaS Using DeepSeek
&lt;/h3&gt;

&lt;p&gt;Here’s a step-by-step guide to earning with SaaS using DeepSeek:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Identify a Niche Problem&lt;/strong&gt;: The key to a successful SaaS product is solving a specific pain point. Use DeepSeek’s data analysis tools to identify gaps in the market or inefficiencies in existing workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leverage AI Capabilities&lt;/strong&gt;: Integrate DeepSeek’s AI features, such as sentiment analysis, predictive analytics, or chatbot functionality, to add value to your SaaS product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build a Scalable Solution&lt;/strong&gt;: Develop a user-friendly, cloud-based platform that customers can access via subscription. Ensure it’s scalable to accommodate growing demand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetize Your SaaS&lt;/strong&gt;: Offer tiered pricing plans (e.g., basic, premium, enterprise) to cater to different customer segments. You can also charge for additional features or usage limits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Market Your Product&lt;/strong&gt;: Use DeepSeek’s insights to optimize your marketing strategy, targeting the right audience with personalized messaging.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbktzly76nvawjdm17gzc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbktzly76nvawjdm17gzc.jpg" alt="Financial Freedom" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3 Examples of SaaS Products Built with DeepSeek
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. AI-Powered Customer Support Platform
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Businesses struggle to provide 24/7 customer support without incurring high costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Build a SaaS platform that uses DeepSeek’s natural language processing to create intelligent chatbots. These bots can handle customer inquiries, resolve common issues, and escalate complex problems to human agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetization&lt;/strong&gt;: Charge businesses a monthly subscription fee based on the number of users or interactions. Offer premium features like multilingual support or integration with CRM tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkqwlrma0w1yl91n46vo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkqwlrma0w1yl91n46vo.jpg" alt="customer support" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Predictive Analytics for E-Commerce
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: E-commerce businesses need actionable insights to optimize inventory, pricing, and marketing strategies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Develop a SaaS tool that uses DeepSeek’s predictive analytics to analyze sales data, customer behavior, and market trends. The platform can provide recommendations for inventory management, dynamic pricing, and targeted marketing campaigns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetization&lt;/strong&gt;: Offer tiered pricing based on the size of the business (e.g., small, medium, enterprise). Include advanced features like real-time analytics and AI-driven forecasts in higher-tier plans.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl99shybcl4scnnkd6gk7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl99shybcl4scnnkd6gk7.jpg" alt="benefits of ecommerce analytics" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Automated Content Creation Tool
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Content creators and marketers spend hours writing blogs, social media posts, and ad copy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Create a SaaS platform powered by DeepSeek’s AI to generate high-quality content in minutes. Users can input keywords or topics, and the tool will produce SEO-optimized articles, captions, or ad copy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetization&lt;/strong&gt;: Use a subscription model with plans based on the number of content pieces generated per month. Offer add-ons like plagiarism checks or multilingual content generation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0hhifjqyvh6ldacwjfdr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0hhifjqyvh6ldacwjfdr.png" alt="examples of automated content creation" width="750" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;The SaaS industry is booming, and AI platforms like DeepSeek are opening up new opportunities for entrepreneurs and businesses. By identifying niche problems, leveraging DeepSeek’s advanced tools, and building scalable solutions, you can create SaaS products that generate consistent revenue. Whether it’s an AI-powered customer support platform, a predictive analytics tool, or an automated content creation solution, the possibilities are endless.&lt;/p&gt;

&lt;p&gt;Start exploring &lt;strong&gt;DeepSeek&lt;/strong&gt; today and turn your &lt;strong&gt;SaaS&lt;/strong&gt; idea into a thriving business!&lt;/p&gt;

</description>
      <category>saas</category>
      <category>deepseek</category>
      <category>beginners</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to Integrate DeepSeek API in Laravel</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Mon, 03 Feb 2025 05:57:10 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-integrate-deepseek-api-in-laravel-2cj4</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/how-to-integrate-deepseek-api-in-laravel-2cj4</guid>
      <description>&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before we begin, ensure you have the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Installed&lt;/strong&gt;: A working Laravel application (version 8.x or higher recommended).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DeepSeek API Key&lt;/strong&gt;: Sign up for DeepSeek and obtain your API key from their dashboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guzzle HTTP Client&lt;/strong&gt;: Laravel uses Guzzle by default for making HTTP requests, so no additional installation is required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Set Up Your Laravel Project
&lt;/h3&gt;

&lt;p&gt;If you haven’t already, create a new Laravel project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer create-project laravel/laravel deepseek-integration
&lt;span class="nb"&gt;cd &lt;/span&gt;deepseek-integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Store Your DeepSeek API Key
&lt;/h3&gt;

&lt;p&gt;It’s a good practice to store sensitive information like API keys in environment variables. Open your .env file and add your DeepSeek API key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DEEPSEEK_API_KEY=your_api_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, add the key to your config/services.php file for easy access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return [
    // Other services
    'deepseek' =&amp;gt; [
        'api_key' =&amp;gt; env('DEEPSEEK_API_KEY'),
    ],
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Create a Service Class
&lt;/h3&gt;

&lt;p&gt;To keep your code clean and reusable, create a service class to handle interactions with the DeepSeek API.&lt;/p&gt;

&lt;p&gt;Run the following Artisan command to generate the service class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan make:service DeepSeekService
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a new file at app/Services/DeepSeekService.php. Open the file and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Services&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;GuzzleHttp\Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;GuzzleHttp\Exception\GuzzleException&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DeepSeekService&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$apiKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'base_uri'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'https://api.deepseek.com/v1/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Replace with the actual DeepSeek API endpoint&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.deepseek.api_key'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Make a request to the DeepSeek API.
     *
     * @param string $endpoint
     * @param array $data
     * @return array
     * @throws GuzzleException
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;makeRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'headers'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s1"&gt;'Authorization'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Bearer '&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'Content-Type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s1"&gt;'json'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getBody&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Use the Service in a Controller
&lt;/h3&gt;

&lt;p&gt;Now that the service is set up, let’s use it in a controller. Create a new controller using Artisan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;controller&lt;/span&gt; &lt;span class="nc"&gt;DeepSeekController&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the newly created controller at app/Http/Controllers/DeepSeekController.php and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Services\DeepSeekService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DeepSeekController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$deepSeekService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;DeepSeekService&lt;/span&gt; &lt;span class="nv"&gt;$deepSeekService&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;deepSeekService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$deepSeekService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;analyzeData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Example request data (replace with actual data you want to send to DeepSeek)&lt;/span&gt;
        &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'text'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="s1"&gt;'parameters'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s1"&gt;'language'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'en'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="c1"&gt;// Add other parameters as needed&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;];&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;deepSeekService&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;makeRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'analyze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Replace 'analyze' with the actual endpoint&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;\Exception&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'error'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Define a Route
&lt;/h3&gt;

&lt;p&gt;Next, define a route to access the controller method. Open routes/web.php or routes/api.php and add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\DeepSeekController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/analyze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;DeepSeekController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'analyzeData'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Test the Integration
&lt;/h3&gt;

&lt;p&gt;You can now test the integration by sending a POST request to the /analyze endpoint. For example, using Postman or a frontend form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "text": "This is a sample text to analyze."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is set up correctly, you should receive a response from the DeepSeek API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this tutorial, we’ve successfully integrated the DeepSeek API into a Laravel application. By creating a service class and using Guzzle for HTTP requests, we’ve ensured that our code is clean, reusable, and easy to maintain. You can now extend this integration to include more features provided by DeepSeek.&lt;/p&gt;

&lt;p&gt;Feel free to explore the &lt;a href="https://api-docs.deepseek.com/" rel="noopener noreferrer"&gt;DeepSeek API documentation&lt;/a&gt; for more advanced use cases and endpoints.&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjciqftppml0jxtzcrwev.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjciqftppml0jxtzcrwev.gif" alt="clapping" width="200" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>deepseek</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Deep Seek Trading Agent</title>
      <dc:creator>Ehtesham Ali</dc:creator>
      <pubDate>Wed, 29 Jan 2025 10:58:22 +0000</pubDate>
      <link>https://forem.com/ehtesham_ali_abc367f36a5b/deep-seek-trading-agent-2k0e</link>
      <guid>https://forem.com/ehtesham_ali_abc367f36a5b/deep-seek-trading-agent-2k0e</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://srv.buysellads.com/ads/long/x/T6EK3TDFTTTTTT6WWB6C5TTTTTTGBRAPKATTTTTTWTFVT7YTTTTTTKPPKJFH4LJNPYYNNSZL2QLCE2DPPQVCEI45GHBT" rel="noopener noreferrer"&gt;Agent.ai&lt;/a&gt; Challenge: Full-Stack Agent (&lt;a href="https://dev.to/challenges/agentai"&gt;See Details&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;The Trading GPT AI agent is designed to assist users with trading-related inquiries and provide analyses based on uploaded images. It leverages advanced AI capabilities to deliver insights and recommendations tailored to individual trading needs. This agent aims to enhance user experience by making trading information more accessible and interactive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of the Trading GPT AI Agent:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Interactive Q&amp;amp;A&lt;/strong&gt;: Users can ask questions related to trading strategies, market trends, and more.&lt;br&gt;
&lt;strong&gt;Personalized Insights&lt;/strong&gt;: Provides tailored recommendations based on user queries and uploaded content.&lt;br&gt;
&lt;strong&gt;User -Friendly Interface&lt;/strong&gt;: Designed for easy navigation and interaction.&lt;br&gt;
&lt;strong&gt;Real-Time Updates&lt;/strong&gt;: Offers the latest market information and trading tips. &lt;/p&gt;

&lt;p&gt;The Trading GPT AI agent is built to empower users with comprehensive trading insights and analyses, making it easier to navigate the complexities of the trading world. This agent is focused on providing a seamless and interactive experience for both novice and experienced traders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://agent.ai/profile/6kvpussg66grhz06" rel="noopener noreferrer"&gt;https://agent.ai/profile/6kvpussg66grhz06&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agentaichallenge</category>
      <category>devchallenge</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
