Repository: deepseek-php/deepseek-laravel
Branch: master
Commit: 42d50c4e3d33
Files: 10
Total size: 13.8 KB
Directory structure:
gitextract_u8v3lxou/
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│ └── deepseek.php
├── src/
│ ├── DeepseekLaravelFacade.php
│ ├── DeepseekLaravelServiceProvider.php
│ └── Exceptions/
│ └── ApiKeyIsMissing.php
└── tests/
└── Feature/
└── DeepseekLaravelTest.php
================================================
FILE CONTENTS
================================================
================================================
FILE: CHANGELOG.md
================================================
# Changelog
All notable changes to `deepseek-laravel` will be documented in this file
## 1.0.0 - 201X-XX-XX
- initial release
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Contributions are **welcome** and will be fully **credited**.
Please read and understand the contribution guide before creating an issue or pull request.
## Etiquette
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
## Viability
When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.
## Procedure
Before filing an issue:
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.
Before submitting a pull request:
- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
## Requirements
If the project maintainer has any additional requirements, you will find them listed here.
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
**Happy coding**!
================================================
FILE: LICENSE.md
================================================
MIT License
Copyright (c) deepseek-php
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Deepseek Laravel
Laravel wrapper for **[Deepseek PHP client](https://github.com/deepseek-php/deepseek-php-client)** to seamless [deepseek AI](https://www.deepseek.com) API integration with Laravel applications.
## Table of Contents
- [Installation](#installation)
- [Publishing Configuration File](#publishing-configuration-file)
- [Usage](#usage)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Testing](#testing)
- [Contributors](#contributors-)
- [Changelog](#changelog)
- [Security](#security)
- [License](#license)
## Installation
You can install the package via composer:
```bash
composer require deepseek-php/deepseek-laravel
```
### Publishing Configuration File
```bash
php artisan vendor:publish --tag=deepseek
```
then add token to `.env` file
```php
DEEPSEEK_API_KEY="your_api_key"
```
## Usage
### Basic Usage
```php
use DeepSeekClient;
$deepseek = app(DeepSeekClient::class);
$response = $deepseek->query('Hello deepseek, I am Laravel Framework , how are you Today ^_^ ?')->run();
print_r("deepseek API response : " . $response);
```
**Note**: In easy mode, it will take defaults for all configs [Check Default Values](https://github.com/deepseek-php/deepseek-php-client/blob/master/src/Enums/Configs/DefaultConfigs.php)
### Advanced Usage
```php
use DeepSeekClient;
$deepseek = app(DeepSeekClient::class);
// Another way, with customization
$response = $deepseek
->query('Hello deepseek, how are you ?', 'system')
->query('Hello deepseek, my name is PHP ', 'user')
->withModel("deepseek-chat")
->setTemperature(1.5)
->run();
print_r("deepseek API response : " . $response);
```
## Testing
Tests will come soon
## Contributors ✨
Thanks to these wonderful people for contributing to this project! 💖
<table>
<tr>
<td align="center">
<a href="https://github.com/omaralalwi">
<img src="https://avatars.githubusercontent.com/u/25439498?v=4" width="70px;" alt="Omar AlAlwi"/>
<br />
<sub><b>Omar AlAlwi</b></sub>
</a>
<br />
🏆 Creator
</td>
<td align="center">
<a href="https://github.com/A909M">
<img src="https://avatars.githubusercontent.com/u/119125167?v=4" width="70px;" alt="Asim Al-Wasai"/>
<br />
<sub><b> Assem Alwaseai </b></sub>
</a>
<br />
💻 Contributor
</td>
<!-- Contributors -->
</td>
<td align="center">
<a href="https://github.com/200-0K">
<img src="https://avatars.githubusercontent.com/u/38166228?v=4" width="70px;" alt="Faisal"/>
<br />
<sub><b> Faisal </b></sub>
</a>
<br />
💻 Contributor
</td>
<!-- Contributors -->
</tr>
</table>
Want to contribute? Check out the [contributing guidelines](./CONTRIBUTING.md) and submit a pull request! 🚀
### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
---
<div>
# 🐘✨ **DeepSeek PHP Community** ✨🐘
Click the button bellow or [join here](https://t.me/deepseek_php_community) to be part of our growing community!
[](https://t.me/deepseek_php_community)
### **Channel Structure** 🏗️
- 🗨️ **General** - Daily chatter
- 💡 **Ideas & Suggestions** - Shape the community's future
- 📢 **Announcements & News** - Official updates & news
- 🚀 **Releases & Updates** - Version tracking & migration support
- 🐞 **Issues & Bug Reports** - Collective problem-solving
- 🤝 **Pull Requests** - Code collaboration & reviews
</div>
---
### Security
If you discover any security-related issues, please email [omaralwi2010@gmail.com](mailto:omaralwi2010@gmail.com) instead of using the issue tracker.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
================================================
FILE: composer.json
================================================
{
"name": "deepseek-php/deepseek-laravel",
"description": "A seamless Laravel integration for the Deepseek PHP client, enabling effortless interaction with the Deepseek API in your Laravel applications.",
"keywords": [
"deepseek-php",
"deepseek-laravel",
"deepseek-coder",
"DeepSeek-R1",
"DeepSeek-R1-Zero",
"deepseek-chat",
"deepseek-math",
"deepseek-php-client",
"deepseek-api",
"laravel-ai",
"laravel-deepseek",
"deepseek-package",
"php-deepseek",
"deepseek-integration",
"deepseek-integration",
"openai"
],
"homepage": "https://github.com/deepseek-php/deepseek-laravel",
"license": "MIT",
"type": "library",
"version": "2.0.2",
"authors": [
{
"name": "deepseek-php",
"email": "omaralwi2010@gmail.com",
"role": "Owner"
},
{
"name": "Omar Alalwi",
"email": "omaralwi2010@gmail.com",
"role": "creator"
}
],
"require": {
"php": "^8.1.0",
"deepseek-php/deepseek-php-client": "^2.0",
"illuminate/support": "^9.0|^10.0|^11.0|^12.0",
"nyholm/psr7": "^1.8",
"symfony/http-client": "^7.2"
},
"require-dev": {
"orchestra/testbench": "^7.0|^8.0",
"phpunit/phpunit": "^9.0|^10.0"
},
"autoload": {
"psr-4": {
"DeepSeek\\DeepseekLaravel\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"DeepSeek\\DeepseekLaravel\\Tests\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
},
"extra": {
"laravel": {
"providers": [
"DeepSeek\\DeepseekLaravel\\DeepseekLaravelServiceProvider"
],
"aliases": {
"DeepseekLaravel": "DeepSeek\\DeepseekLaravel\\DeepseekLaravelFacade"
}
}
}
}
================================================
FILE: config/deepseek.php
================================================
<?php
use DeepSeek\Enums\Configs\DefaultConfigs;
return [
/*
|--------------------------------------------------------------------------
| API Key
|--------------------------------------------------------------------------
|
| The API key used to authenticate requests to the Deepseek API. This key
| is required for all API interactions. Ensure that you set this value in
| your environment file (.env) as DEEPSEEK_API_KEY to keep it secure.
|
*/
'api_key' => env('DEEPSEEK_API_KEY'),
/*
|--------------------------------------------------------------------------
| Base URL
|--------------------------------------------------------------------------
|
| The base URL for the Deepseek API. By default, it uses the value defined
| in DefaultConfigs::BASE_URL. You can override this by setting the
| DEEPSEEK_API_BASE_URL variable in your environment file if you need to
| connect to a custom endpoint.
|
*/
'base_url' => env('DEEPSEEK_API_BASE_URL', (string) DefaultConfigs::BASE_URL->value),
/*
|--------------------------------------------------------------------------
| API Timeout
|--------------------------------------------------------------------------
|
| The maximum time, in seconds, for API requests to complete before timing
| out. This helps prevent your application from waiting indefinitely for
| a response. The default value is taken from DefaultConfigs::TIMEOUT.
| You can override it in the environment file by setting DEEPSEEK_API_TIMEOUT.
|
*/
'timeout' => env('DEEPSEEK_API_TIMEOUT', (int) DefaultConfigs::TIMEOUT->value),
];
================================================
FILE: src/DeepseekLaravelFacade.php
================================================
<?php
namespace DeepSeek\DeepseekLaravel;
use Illuminate\Support\Facades\Facade;
class DeepseekLaravelFacade extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'deepseek-laravel';
}
}
================================================
FILE: src/DeepseekLaravelServiceProvider.php
================================================
<?php
namespace DeepSeek\DeepseekLaravel;
use DeepSeek\DeepSeekClient;
use Illuminate\Support\ServiceProvider;
use DeepSeek\DeepseekLaravel\Exceptions\ApiKeyIsMissing;
class DeepseekLaravelServiceProvider extends ServiceProvider
{
public function boot()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/deepseek.php' => config_path('deepseek.php'),
], 'deepseek');
}
}
/**
* Register the application services.
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/deepseek.php', 'deepseek');
$this->app->singleton(DeepSeekClient::class, function () {
$apiKey = config('deepseek.api_key');
$baseUrl = config('deepseek.base_url');
$timeout = config('deepseek.timeout');
if (! is_string($apiKey)) {
throw ApiKeyIsMissing::create();
}
return DeepSeekClient::build($apiKey, $baseUrl, $timeout);
});
}
}
================================================
FILE: src/Exceptions/ApiKeyIsMissing.php
================================================
<?php
declare(strict_types=1);
namespace DeepSeek\DeepseekLaravel\Exceptions;
use InvalidArgumentException;
/**
* @internal
*/
final class ApiKeyIsMissing extends InvalidArgumentException
{
/**
* Create a new exception instance.
*/
public static function create(): self
{
return new self(
'The Deepseek API key is not set. Please ensure `DEEPSEEK_API_KEY` is configured in your .env file.',
);
}
}
================================================
FILE: tests/Feature/DeepseekLaravelTest.php
================================================
<?php
namespace Feature;
use DeepSeekClient;
use DeepSeek\Enums\Configs\DefaultConfigs;
use Illuminate\Support\Facades\Config;
use Orchestra\Testbench\TestCase;
class DeepseekLaravelTest extends TestCase
{
/** @test */
public function it_can_query_using_the_deepseek_client()
{
// soon
}
/** @test */
public function it_uses_default_configurations()
{
// soon
}
}
gitextract_u8v3lxou/
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│ └── deepseek.php
├── src/
│ ├── DeepseekLaravelFacade.php
│ ├── DeepseekLaravelServiceProvider.php
│ └── Exceptions/
│ └── ApiKeyIsMissing.php
└── tests/
└── Feature/
└── DeepseekLaravelTest.php
SYMBOL INDEX (10 symbols across 4 files)
FILE: src/DeepseekLaravelFacade.php
class DeepseekLaravelFacade (line 7) | class DeepseekLaravelFacade extends Facade
method getFacadeAccessor (line 14) | protected static function getFacadeAccessor()
FILE: src/DeepseekLaravelServiceProvider.php
class DeepseekLaravelServiceProvider (line 9) | class DeepseekLaravelServiceProvider extends ServiceProvider
method boot (line 11) | public function boot()
method register (line 24) | public function register()
FILE: src/Exceptions/ApiKeyIsMissing.php
class ApiKeyIsMissing (line 12) | final class ApiKeyIsMissing extends InvalidArgumentException
method create (line 17) | public static function create(): self
FILE: tests/Feature/DeepseekLaravelTest.php
class DeepseekLaravelTest (line 10) | class DeepseekLaravelTest extends TestCase
method it_can_query_using_the_deepseek_client (line 13) | public function it_can_query_using_the_deepseek_client()
method it_uses_default_configurations (line 19) | public function it_uses_default_configurations()
Condensed preview — 10 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (15K chars).
[
{
"path": "CHANGELOG.md",
"chars": 129,
"preview": "# Changelog\n\nAll notable changes to `deepseek-laravel` will be documented in this file\n\n## 1.0.0 - 201X-XX-XX\n\n- initial"
},
{
"path": "CONTRIBUTING.md",
"chars": 2972,
"preview": "# Contributing\n\nContributions are **welcome** and will be fully **credited**.\n\nPlease read and understand the contributi"
},
{
"path": "LICENSE.md",
"chars": 1063,
"preview": "MIT License\n\nCopyright (c) deepseek-php\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof"
},
{
"path": "README.md",
"chars": 3863,
"preview": "# Deepseek Laravel\n\nLaravel wrapper for **[Deepseek PHP client](https://github.com/deepseek-php/deepseek-php-client)** t"
},
{
"path": "composer.json",
"chars": 2197,
"preview": "{\n \"name\": \"deepseek-php/deepseek-laravel\",\n \"description\": \"A seamless Laravel integration for the Deepseek PHP c"
},
{
"path": "config/deepseek.php",
"chars": 1696,
"preview": "<?php\n\nuse DeepSeek\\Enums\\Configs\\DefaultConfigs;\n\nreturn [\n\n /*\n |-----------------------------------------------"
},
{
"path": "src/DeepseekLaravelFacade.php",
"chars": 322,
"preview": "<?php\n\nnamespace DeepSeek\\DeepseekLaravel;\n\nuse Illuminate\\Support\\Facades\\Facade;\n\nclass DeepseekLaravelFacade extends "
},
{
"path": "src/DeepseekLaravelServiceProvider.php",
"chars": 1063,
"preview": "<?php\n\nnamespace DeepSeek\\DeepseekLaravel;\n\nuse DeepSeek\\DeepSeekClient;\nuse Illuminate\\Support\\ServiceProvider;\nuse Dee"
},
{
"path": "src/Exceptions/ApiKeyIsMissing.php",
"chars": 458,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace DeepSeek\\DeepseekLaravel\\Exceptions;\n\nuse InvalidArgumentException;\n\n/**\n * @"
},
{
"path": "tests/Feature/DeepseekLaravelTest.php",
"chars": 416,
"preview": "<?php\n\nnamespace Feature;\n\nuse DeepSeekClient;\nuse DeepSeek\\Enums\\Configs\\DefaultConfigs;\nuse Illuminate\\Support\\Facades"
}
]
About this extraction
This page contains the full source code of the deepseek-php/deepseek-laravel GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 10 files (13.8 KB), approximately 3.7k tokens, and a symbol index with 10 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.