michael-rubel/laravel-sql-function-repository

该软件包已被废弃,不再维护。未建议替代包。

这是一个 Laravel 软件包的示例模板。您可以按需填写或修改。

1.1.2 2023-01-19 12:01 UTC

This package is auto-updated.

Last update: 2024-03-15 19:40:28 UTC


README

Run database function

Laravel SQL Function Repository

Latest Version on Packagist Total Downloads Code Quality Code Coverage GitHub Tests Action Status PHPStan

此软件包提供了一种仓库类,用于运行数据库中可用的 SQL 函数。目前,仅支持 PostgreSQL 数据库,但如果您想添加对您数据库的支持,欢迎贡献。

该软件包需要 PHP 8 或更高版本和 Laravel 9 或更高版本。

#StandWithUkraine

SWUbanner

安装

使用 composer 安装此软件包

composer require michael-rubel/laravel-sql-function-repository

发布配置,设置基本连接并选择

php artisan vendor:publish --tag="sql-function-repository-config"

使用

$repository = app(SqlFunctionRepository::class);
$repository->runDatabaseFunction('yourFunctionName', [
    'functionParameter1',
    'functionParameter2',
]);

测试

composer test

许可

MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。