PHPackages                             aacassandra/laraquent - 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. aacassandra/laraquent

ActiveLibrary

aacassandra/laraquent
=====================

Save your time with Laraquent, for CRUD your laravel project

2.0.8(5y ago)1877MITPHP

Since Mar 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/aacassandra/laraquent)[ Packagist](https://packagist.org/packages/aacassandra/laraquent)[ RSS](/packages/aacassandra-laraquent/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (21)Used By (0)

Beauty Eloquent
===============

[](#beauty-eloquent)

This is a package for laravel framework especially for CRUD activities. This package uses the eloquent laravel style and doesn't leave the default eloquent style. It's just that this package makes it easier for us to perform CRUD activities without including the model dependency on the associated controller.

Suported Features
-----------------

[](#suported-features)

- Create
- Read
- Update
- Delete
- User
- CreateUser
- UpdateUser
- DeleteUser
- Users

Laravel Permission Features
---------------------------

[](#laravel-permission-features)

if you use the [spatie/laravel-permission](https://github.com/spatie/laravel-permission), then the features below can be used in a shorter method

- Roles
- CreateRole
- UpdateRole
- DeleteRole
- Permissions

Installation in Laravel
-----------------------

[](#installation-in-laravel)

This package can be used with Laravel 5 or higher.

1. Consult the Prerequisites page for important considerations regarding your User models!
2. This package publishes a config/laraquent.php file. If you already have a file by that name, you must rename or remove it.
3. You can install the package via composer:

```
composer require aacassandra/laraquent

```

4. In the $providers array add the service providers in your config/app.php file:

```
'providers' => [
    /*
    * Package Service Providers
    */
    // ...
    Laraquent\BeautyEloquentProvider::class,
];

```

5. Add the facade of this package to the $aliases array.

```
'aliases' => [
    // ...
    'BeautyEloquent' => Laraquent\BeautyEloquent::class,
]

```

6. You must publish the config. which will later be on the config/laraquent.php config file with:

```
php artisan vendor:publish --provider="Laraquent\BeautyEloquentProvider"

```

7. Now the Image Class will be auto-loaded by Laravel.

Default Config File Contents
----------------------------

[](#default-config-file-contents)

You can view the default config file contents at:

Basic Usage
-----------

[](#basic-usage)

Below are some basic examples for using laravel's CRUD functions

#### Create Object

[](#create-object)

Format

```
BeautyEloquent::Create($model = '', $data = []);

```

Example

```
$data = [
    ['name', 'Jhon Doe'],
    ['age', 33],
    ['address', 'Kampoeng Street']
];
$create = BeautyEloquent::Create('Product', $data);
dd($create); // Output

```

#### Read Object

[](#read-object)

Format

```
BeautyEloquent::Read($model = '', $options = []);

```

Example

```
$options = [
    'where' => [
        ['role','=','admin'],
        [...], //and more
    ],
    'orWhere' => [
        ['role','=','admin'],
        [...], //and more
    ],
    'whereJsonContains' => [
        ['slug->en', 'article-part-2'],
        [...], //and more
    ],
    'whereRaw' => [
        ['price > IF(state = "TX", ?, 100)', [200]],
        [...], //and more
    ],
    'orWhereRaw' => [
        ['price > IF(state = "TX", ?, 100)', [200]],
        [...], //and more
    ]
    'orderBy' => ['id', 'DESC'], //ASC or DESC
    'limit' => 2,
    'first' => true //if the result has a return value of 1 and no more and return json objects,
    'paginate' => [3, 'home'] //{x, y} : x => the amount of content to be displayed, y : pageName for multi pagination (optional)
];

$read = BeautyEloquent::Read('Product', $options);
dd($read); // Output

```

#### Update Object

[](#update-object)

Format

```
BeautyEloquent::Update($model = '', $data = [], $options = []);

```

Example

```
$data = [
    ['name', 'Jhon Doe'],
    ['age', 33],
    ['address', 'Kampoeng Street']
];

$options = [
    'where' => [
        ['status','=','sale'],
        [...], //and more
    ],
    'orwhere => [
        ['price','>=', 100],
        [...], //and more
    ],
    'id' => 3
];

$update = BeautyEloquent::Update('Product', $data, $options);
dd($update); // Output

```

#### Delete Object

[](#delete-object)

Format

```
BeautyEloquent::Delete($table = '', $options = []);

```

Example

```
$options = [
    'where' => [
        ['status','=','sale'],
        [...], //and more
    ],
    'orwhere => [
        ['price','>=', 100],
        [...], //and more
    ],
    'id' => 3
];

$delete = BeautyEloquent::Delete('Product', $options);
dd($delete); // Output

```

Advance Usage
-------------

[](#advance-usage)

Below are some advance examples with [spatie/laravel-permission](https://github.com/spatie/laravel-permission) integration if needed

#### Roles

[](#roles)

Show all roles

```
$options = [
    //Same as with the conditionals in the Read Object function
];
$roles = BeautyEloquent::Roles($options)
dd($roles); // Output

```

#### Create Role

[](#create-role)

```
$name = 'Admin';
$permissions = ['1','2','3']; // id of permission, you can use string or number format
$createRole = BeautyEloquent::CreateRole($name, $permissions)
dd($createRole); // Output

```

#### Update Role

[](#update-role)

```
$id = 1;
$name = 'New Admin';
$permissions = ['1','2','3']; // id of permission, you can use string or number format
$updateRole = BeautyEloquent::UpdateRole($id, $name, $permissions)
dd($updateRole); // Output

```

#### Delete Role

[](#delete-role)

```
$id = 1;
$deleteRole = BeautyEloquent::DeleteRole($id)
dd($deleteRole); // Output

```

#### Permissions

[](#permissions)

Show all permissions

```
$options = [
    //Same as with the conditionals in the Read Object function
];
$permissions = BeautyEloquent::Permissions($options)
dd($permissions); // Output

```

#### User

[](#user)

Get specific user by id

```
$id = 1;
$user = BeautyEloquent::User($id)
dd($user); // Output

```

#### Users

[](#users)

Get all users

```
$options = [
    //Same as with the conditionals in the Read Object function
];
$users = BeautyEloquent::Users($options)
dd($users); // Output

```

#### Create User

[](#create-user)

```
$data = [
    ['name', 'Jhon Doe'],
    ['age', 33],
    ['address', 'Kampoeng Street'],
    [...], //and more
];
$roles = ['Admin', 'Super Admin', ...]; // string of role name
$createUser = BeautyEloquent::CreateUser($data, $roles)
dd($createUser); // Output

```

#### Update User

[](#update-user)

```
$id = 1;
$data = [
    ['name', 'Jhon Doe'],
    ['age', 33],
    ['address', 'Kampoeng Street'],
    [...], //and more
];
$roles = ['Admin', 'Super Admin', ...]; // string of role name
$updateUser = BeautyEloquent::UpdateUser($id, $data, $roles)
dd($updateUser); // Output

```

#### Delete User

[](#delete-user)

```
$id = 1;
$deleteUser = BeautyEloquent::DeleteUser($id)
dd($deleteUser); // Output

```

Package Config Must Be Configure
--------------------------------

[](#package-config-must-be-configure)

Config file must be configure if you using laravel 8, because file models on laravel 8 has been moved to Models directory

```
    'model' => [
        /**
         * The default directory of models
         */
        'directory' => 'App\Models',
        /**
         * Default of User Model
         */
        'user' => 'App\Models\User',
        /**
         * If using [spatie/laravel-permission]
         * you must set default model off this
         */
        'role' => 'Spatie\Permission\Models\Role',
        'permission' => 'Spatie\Permission\Models\Permission'
    ],

```

make sure you always update about **role** models and **permissions**. you can check it on their official website of [spatie/laravel-permission](https://github.com/spatie/laravel-permission)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/aacassandra/laraquent/blob/master/LICENSE) file for details

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~14 days

Recently: every ~2 days

Total

20

Last Release

1990d ago

Major Versions

0.0.2 → 1.0.02020-03-04

1.0.8 → 2.0.02020-10-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d21c087127689b7a04605271c838436fe95f9c66a6ff1d99c30cb5ebf236d4e?d=identicon)[aacassandra](/maintainers/aacassandra)

---

Top Contributors

[![aacassandra](https://avatars.githubusercontent.com/u/29236058?v=4)](https://github.com/aacassandra "aacassandra (20 commits)")

### Embed Badge

![Health badge](/badges/aacassandra-laraquent/health.svg)

```
[![Health](https://phpackages.com/badges/aacassandra-laraquent/health.svg)](https://phpackages.com/packages/aacassandra-laraquent)
```

PHPackages © 2026

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