PHP Classes

Laravel ChatGPT: Integrate ChatGPT in a Laravel Nova panel

Recommend this page to a friend!
  Info   Documentation   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 51 All time: 10,685 This week: 86Up
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
Age: ???
All time rank: 18566 in Saudi Arabia Saudi Arabia
Week rank: 131 Up2 in Saudi Arabia Saudi Arabia Up
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 (5)  
  • screenshots/dark-home.png
  • screenshots/history.png
  • screenshots/light-home.png
  • screenshots/question.png
  • screenshots/view.png
  Files folder image Files (30)  
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 (30)  /  config  
File Role Description
  Accessible without login Plain text file chatgpt-nova4.php Aux. Auxiliary script

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

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

  Files folder image Files (30)  /  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 (30)  /  dist  /  css  
File Role Description
  Accessible without login Plain text file tool.css Data Auxiliary data

  Files folder image Files (30)  /  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 (30)  /  resources  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (1 file, 1 directory)

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

  Files folder image Files (30)  /  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 (30)  /  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 (30)  /  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 (30)  /  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 (30)  /  src  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (1 file)

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

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

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:51
This week:0
All time:10,685
This week:86Up