PHPackages                             onursimsek/laravel-extended - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. onursimsek/laravel-extended

ActiveLibrary

onursimsek/laravel-extended
===========================

This is my package laravel-extended

1.3.0(4mo ago)2753MITPHPPHP ^8.2|^8.3|^8.4|^8.5CI passing

Since Sep 8Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/onursimsek/laravel-extended)[ Packagist](https://packagist.org/packages/onursimsek/laravel-extended)[ Docs](https://github.com/onursimsek/laravel-extended)[ GitHub Sponsors](https://github.com/onursimsek)[ RSS](/packages/onursimsek-laravel-extended/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (11)Versions (9)Used By (0)

   ![Package Image](https://camo.githubusercontent.com/6a3f4e0d682edb5693fc289bdb7b9a80c82be7ee6cca7a90e7d5e894a310e018/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230457874656e6465642e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6f6e757273696d73656b2532466c61726176656c2d657874656e646564267061747465726e3d746f706f677261706879267374796c653d7374796c655f31266465736372697074696f6e3d457874656e642b796f75722b4c61726176656c2b70726f6a6563742b776974682b6d6978696e732b616e642b6d6f726573266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d6172726f77732d657870616e64)Extend your Laravel project with mixins and mores
=================================================

[](#extend-your-laravel-project-with-mixins-and-mores)

[![Latest Version on Packagist](https://camo.githubusercontent.com/43e84464c9f22bd8354860af07f65a144a91ea765770d8b0875d46e75777a0de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6e757273696d73656b2f6c61726176656c2d657874656e6465642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onursimsek/laravel-extended)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/05d7f0626622a3676e2e171e4820f6717de26dcbf01767082f48f5ae61a4bf58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f6e757273696d73656b2f6c61726176656c2d657874656e6465642f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/onursimsek/laravel-extended/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Tests](https://github.com/onursimsek/laravel-extended/actions/workflows/run-tests.yml/badge.svg)](https://github.com/onursimsek/laravel-extended/actions)[![Total Downloads](https://camo.githubusercontent.com/c71c93338fe9826a97b60d154f5c4bb53f72099ba5b828ba306e64d92f287fd9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6e757273696d73656b2f6c61726176656c2d657874656e6465642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onursimsek/)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require onursimsek/laravel-extended
```

Contents
--------

[](#contents)

- [Illuminate\\Database\\Query\\Builder](#extended-illuminatedatabasequerybuilder)
- [Illuminate\\Support\\Str](#extended-illuminatesupportstr)
- [Illuminate\\Support\\Stringable](#extended-illuminatesupportstringable)
- [Useful Traits](#useful-traits)
    - [InteractsWithDatabase](#interactswithdatabase)
        - [beginTransaction](#begintransactionstring-connections-void)
        - [commit](#commitstring-connections-void)
        - [commitAll](#commitall-void)
        - [rollBack](#rollbackstring-connections-void)
        - [rollBack](#rollbackall-void)
        - [Example](#interactswithdatabase-example)
    - [HasName](#hasname)
        - [names](#names)
    - [HasValue](#hasvalue)
        - [value](#values-and-names)
    - [GetAttributes](#getattributes)

Usage
-----

[](#usage)

### Extended Illuminate\\Database\\Query\\Builder

[](#extended-illuminatedatabasequerybuilder)

```
Product::whereGreaterThan('price', 500)->get();
// select * from products where price > 500
Product::whereGreaterThanOrEqual('price', 500)->get();
// select * from products where price >= 500

Product::whereLessThan('price', 500)->get();
// select * from products where price < 500
Product::whereLessThanOrEqual('price', 500)->get();
// select * from products where price get();
// select * from products where price > amount
Product::whereColumnGreaterThanOrEqual('price', 'amount')->get();
// select * from products where price >= amount

Product::whereColumnLessThan('price', 'amount')->get();
// select * from products where price < amount
Product::whereColumnLessThanOrEqual('price', 'amount')->get();
// select * from products where price get();
// select * from products
Product::whenWhere(true, 'is_active')->get();
// select * from products where is_active = 1
```

### Extended Illuminate\\Support\\Str

[](#extended-illuminatesupportstr)

```
use Illuminate\Support\Str;

Str::squishBetween("I\twill kiss\t\nyou!", 'kiss', 'you');
// I       will kiss you!
Str::replaceBetween('I will kiss you!', 'will', 'you', 'miss');
// I will miss you!
Str::replaceBetweenMatch('I will kiss you!', 'will', 'you', '/k(.*)s/', 'hug');
// I will hug you!
```

### Extended Illuminate\\Support\\Stringable

[](#extended-illuminatesupportstringable)

```
use Illuminate\Support\Str;

Str::of("I\twill kiss\t\nyou!")->squishBetween('kiss', 'you');
// I       will kiss you!
Str::of('I will kiss you!')->replaceBetween('will', 'you', 'miss');
// I will miss you!
Str::of('I will kiss you!')->replaceBetweenMatch('will', 'you', '/k(.*)s/', 'hug');
// I will hug you!
```

Useful Traits
-------------

[](#useful-traits)

### InteractsWithDatabase

[](#interactswithdatabase)

This trait provides an easy way to manage database transactions across multiple connections. It allows you to **begin**, **commit**, and **roll back** transactions.

#### beginTransaction(string ...$connections): void

[](#begintransactionstring-connections-void)

This method starts a transaction on the specified database connections. If no connections are provided, the default database connection specified in your Laravel configuration will be used.

```
$this->beginTransaction(); // Starts transaction on default connection
$this->beginTransaction('mysql', 'sqlite'); // Starts transactions on the 'mysql' and 'sqlite' connections
```

#### commit(string ...$connections): void

[](#commitstring-connections-void)

This method commits a transaction on the specified connections. If no connections are specified, nothing will happen.

```
$this->commit(); // No action taken (no specific connection provided)
$this->commit('mysql', 'sqlite'); // Commits the transactions on the 'mysql' and 'sqlite' connections
```

#### commitAll(): void

[](#commitall-void)

This method commits transactions on all connections that have begun a transaction during the lifetime of the object.

```
$this->commitAll(); // Commits all active transactions
```

#### rollBack(string ...$connections): void

[](#rollbackstring-connections-void)

This method rolls back a transaction on the specified connections.

```
$this->rollBack(); // Rolls back on the default connection
$this->rollBack('mysql', 'sqlite'); // Rolls back on the 'mysql' and 'sqlite' connections
```

#### rollBackAll(): void

[](#rollbackall-void)

This method rolls back transactions on all connections that have begun a transaction during the lifetime of the object.

```
$this->rollBackAll(); // Rolls back all active transactions
```

#### InteractsWithDatabase Example

[](#interactswithdatabase-example)

```
namespace App\Http\Controllers\Controller;

use OnurSimsek\LaravelExtended\Support\InteractsWithDatabase;

class Controller
{
    use InteractsWithDatabase;

    public function store()
    {
        $this->beginTransaction('mysql', 'pgsql');

        try {
            // Your data processing logic

            $this->commitAll(); // Commit the transactions if everything goes well
        } catch (\Exception $e) {
            $this->rollBackAll(); // Roll back if an error occurs
            throw $e;
        }
    }
}
```

### HasName

[](#hasname)

This trait converts the **names** of *UnitEnum* into an array.

#### names()

[](#names)

```
enum Status
{
    use HasName;

    case Active;
    case Inactive;
}

Status::names(); // ['Active', 'Inactive']
```

### HasValue

[](#hasvalue)

#### values() and names()

[](#values-and-names)

This trait converts the **names** and **values** of *BackedEnum* into an array

```
enum Status: string
{
    use HasValue;

    case Active = 'active';
    case Inactive = 'inactive';
}

Status::names();  // ['Active', 'Inactive']
Status::values(); // ['active', 'inactive']
```

### GetAttributes

[](#getattributes)

```
use App\Enums\Concerns\Name;
use App\Enums\Concerns\Symbol;
use OnurSimsek\LaravelExtended\Support\Enums\GetAttributes;

enum Currency
{
    use GetAttributes;

    #[Name('Turkish Lira')]
    #[Symbol('₺')]
    case TRY;

    #[Name('US Dollar')]
    #[Symbol('$')]
    case USD;

    #[Name('Euro')]
    #[Symbol('€')]
    case EUR:
}

Currency::EUR->name();      // Euro
Currency::TRY->symbol();    // ₺
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Onur Şimşek](https://github.com/onursimsek)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance84

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 64.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~119 days

Total

6

Last Release

130d ago

PHP version history (2 changes)1.0.0PHP ^8.2|^8.3

1.3.0PHP ^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ba5c91cbc3d2b9783d33a0f45f2b751560de0b96df93d866418abe138f561f0?d=identicon)[onursimsek](/maintainers/onursimsek)

---

Top Contributors

[![onursimsek](https://avatars.githubusercontent.com/u/1241396?v=4)](https://github.com/onursimsek "onursimsek (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![mertasan](https://avatars.githubusercontent.com/u/13007665?v=4)](https://github.com/mertasan "mertasan (1 commits)")

---

Tags

laravel-packagelaravelOnur Şimşeklaravel-extended

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/onursimsek-laravel-extended/health.svg)

```
[![Health](https://phpackages.com/badges/onursimsek-laravel-extended/health.svg)](https://phpackages.com/packages/onursimsek-laravel-extended)
```

###  Alternatives

[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[bilfeldt/laravel-request-logger

Log Laravel application request and responses for debugging or statistics

122163.3k2](/packages/bilfeldt-laravel-request-logger)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
