michael-rubel/laravel-sql-function-repository

This package is abandoned and no longer maintained. No replacement package was suggested.

It is an example template for Laravel packages. Fill or change it the way you like.

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

This package provides a repository class to run SQL functions available in the database. Currently, only PostgreSQL database is supported, but if you want to add support for your database, contributions are welcomed.

The package requires PHP 8 or higher and Laravel 9 or higher.

#StandWithUkraine

SWUbanner

Installation

Install the package using composer:

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

Publish the config, set up basic connection and select:

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

Usage

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

Testing

composer test

License

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