PHP Classes

Laravel ChatGPT: Integrate ChatGPT in a Laravel Nova panel

Recommend this page to a friend!
  Info   View files Documentation   Screenshots Screenshots   View files View files (25)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-08-27 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 47 All time: 10,669 This week: 92Up
Version License PHP version Categories
chatgpt 1.0.0MIT/X Consortium ...7Web services, Artificial intelligence, P...
Description 

Author

This package can integrate ChatGPT in a Laravel Nova panel.

It uses ChatGPT API to provide a Web interface to ChatGPT features in a site that uses the Laravel Nova administration panel.

Currently, it uses ChatGPT API to allow users to:

- Ask questions

- Store questions in a database

- Copy answers so users can paste them into another page or application

- Display the total number of API tokens used for each request

- Track the usage of API token

- Access a history page to see past API usage

- View a question page

- Delete a question

- Clear the usage history

Innovation Award
PHP Programming Innovation award nominee
August 2023
Number 2
ChatGPT is a popular artificial intelligence service that allows users to ask questions using natural language.

Laravel Nova is a package that allows developers to implement modular administration panels in sites implemented using the Laravel framework.

This package implements an integration between the ChatGPT service and a panel that lets users ask questions to the ChatGPT service using its API from a Laravel application.

This possibility allows users of a Laravel application to quickly ask questions and get answers in the same place as a site where the users perform site administration tasks.

Manuel Lemos
Picture of Naif Alshaye
  Performance   Level  
Name: Naif Alshaye <contact>
Classes: 24 packages by
Country: Saudi Arabia Saudi Arabia
Innovation award
Innovation award
Nominee: 9x

Documentation

Laravel Nova 4 ChatGPT Integration Tool

A Laravel Nova 4 ChatGPT Integration Tool combines Laravel Nova 4 with the ChatGPT API.

Features

  • Ask ChatGPT
  • Store questions to database
  • Copy answer
  • Display total Tokens used for each request
  • Tracks token usage
  • History Page for easy reference
  • View question page
  • Delete question
  • Clear history

Requirements

  • PHP 8.0 or higher
  • Nova 4
  • OpenAI API Key
  • ## Installation

You can install the package into a Laravel app that uses Nova via composer:

composer require naif/chatgpt

Publish Model, Migration and Config files

php artisan vendor:publish --provider="Naif\Chatgpt\ToolServiceProvider" 

Run Migrate

php artisan migrate

Add the below to .env file:

CHATGPT_NOVA4_API_KEY=###############
CHATGPT_NOVA4_MAX_TOKENS=1000

You can increase the tokens to get more text from ChatGPT response.

Usage

Add the tool to NovaServiceProvider.php

  public function tools()
    {
        return [
            new Chatgpt()
        ];
    }

Screenshots

<img src="screenshots/dark-home.png" width="800">

<img src="screenshots/light-home.png" width="800">

<img src="screenshots/history.png" width="800">

<img src="screenshots/view.png" width="800">

Support:

naif@naif.io

https://naif.io

Bug Tracker:

https://github.com/naifalshaye/chatgpt-nova4/issues

License

The MIT License (MIT). Please see License File for more information.


Screenshots  
  • screenshots/dark-home.png
  • screenshots/history.png
  • screenshots/light-home.png
  • screenshots/question.png
  • screenshots/view.png
  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagedatabase (1 directory)
Files folder imagedist (1 file, 2 directories)
Files folder imageresources (2 directories)
Files folder imageroutes (2 files)
Files folder imagesrc (2 files, 2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file nova.mix.js Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file postcss.config.js Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file chatgpt-nova4.php Aux. Auxiliary script

  Files folder image Files  /  database  
File Role Description
Files folder imagemigrations (1 file)

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file create_chatgpt_nova4_table.php.stub Class Class source

  Files folder image Files  /  dist  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (2 files)
  Accessible without login Plain text file mix-manifest.json Data Auxiliary data

  Files folder image Files  /  dist  /  css  
File Role Description
  Accessible without login Plain text file tool.css Data Auxiliary data

  Files folder image Files  /  dist  /  js  
File Role Description
  Accessible without login Plain text file tool.js Data Auxiliary data
  Accessible without login Plain text file tool.js.LICENSE.txt Doc. Documentation

  Files folder image Files  /  resources  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (1 file, 1 directory)

  Files folder image Files  /  resources  /  css  
File Role Description
  Accessible without login Plain text file tool.css Data Auxiliary data

  Files folder image Files  /  resources  /  js  
File Role Description
Files folder imagepages (3 files)
  Accessible without login Plain text file tool.js Data Auxiliary data

  Files folder image Files  /  resources  /  js  /  pages  
File Role Description
  Accessible without login Plain text file History.vue Data Auxiliary data
  Accessible without login Plain text file Tool.vue Data Auxiliary data
  Accessible without login Plain text file View.vue Data Auxiliary data

  Files folder image Files  /  routes  
File Role Description
  Plain text file api.php Class Class source
  Accessible without login Plain text file inertia.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageHttp (2 directories)
Files folder imageModels (1 file)
  Plain text file Chatgpt.php Class Class source
  Plain text file ToolServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (1 file)

  Files folder image Files  /  src  /  Http  /  Controllers  
File Role Description
  Plain text file ChatGPTController.php Class Class source

  Files folder image Files  /  src  /  Http  /  Middleware  
File Role Description
  Plain text file Authorize.php Class Class source

  Files folder image Files  /  src  /  Models  
File Role Description
  Plain text file ChatGPTNova4.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:47
This week:0
All time:10,669
This week:92Up