chatbox-inc / laravel-transaction
Installs: 3 422
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires (Dev)
- laravel/laravel: ^5.8
This package is auto-updated.
Last update: 2024-11-13 05:13:07 UTC
README
This - Laravel Transaction provide Auto Transaction to your Laravel Application.
Install
You can install via composer
$ composer require chatbox-inc/laravel-transaction
Usage
You can use middleware \Chatbox\LaravelTransaction\Http\Middleware\LaravelTransactionMiddleware
.
if you load LaravelTransactionServiceProvider
(normally auto discovered),
you can use middleware alias transact_db
.
Global Usage
If you need transaction to your all routes,
add middleware in the $middleware
property of app/Http/Kernel.php
protected $middleware = [ // ... \Chatbox\LaravelTransaction\Http\Middleware\LaravelTransactionMiddleware::class ];
or you can apply it to middleware group by using $middlewareGroups
property .
protected $middlewareGroups = [ // ... 'api' => [ // ... \Chatbox\LaravelTransaction\Http\Middleware\LaravelTransactionMiddleware::class ], ];
With LaravelTransactionServiceProvider
(normally auto discovered), you can use alias transact_db
.
protected $middlewareGroups = [ // ... 'api' => [ // ... "transact_db" ], ];
Of caurse, you can use this middleware per route if you need.