Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

michael-rubel/laravel-sql-function-repository

Repository files navigation

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.