PHPackages                             leandrowkz/laravel-basis - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leandrowkz/laravel-basis

ActiveProject[Utility &amp; Helpers](/categories/utility)

leandrowkz/laravel-basis
========================

Laravel Basis is a package that provides a base service layer to your application, containing CRUD operations.

v4.0.0(5y ago)1748MITPHPPHP ^7.3CI failing

Since Jun 7Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (26)Used By (0)

Laravel Basis
=============

[](#laravel-basis)

[![Build Status](https://camo.githubusercontent.com/50c12857da3a71a91143ea9738b7b029f5898fc6516f860dfb62d72cbcdcfb4a/68747470733a2f2f7472617669732d63692e636f6d2f6c65616e64726f776b7a2f6c61726176656c2d62617369732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/leandrowkz/laravel-basis)[![Latest Stable Version](https://camo.githubusercontent.com/fb06c6a5db313bd89af887754f8340416ce7e65d55c1793de7e70b69c0abda3c/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f776b7a2f6c61726176656c2d62617369732f762f737461626c65)](https://packagist.org/packages/leandrowkz/laravel-basis)[![License](https://camo.githubusercontent.com/0dd2b917ad0e3f7ce6e8a79f216e880f2d12b83c5f3d7d40079bcfa56948a317/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f776b7a2f6c61726176656c2d62617369732f6c6963656e7365)](https://packagist.org/packages/leandrowkz/laravel-basis)

Laravel Basis is a package that provides a base CRUD layer for your application.

[![Laravel Basis](laravel-basis.png?raw=true "Laravel Basis")](laravel-basis.png?raw=true)

- `Leandrowkz\Basis\Controllers\BaseController`
- `Leandrowkz\Basis\Services\BaseService`
- `Leandrowkz\Basis\Traits\AccessibleProps`
- `Leandrowkz\Basis\Traits\MutatesProps`

These classes provides an easy way to CRUD operations inside Laravel apps. All you have to do is to extend and configure your classes from those available here.

#### `Leandrowkz\Basis\Controllers\BaseController`

[](#leandrowkzbasiscontrollersbasecontroller)

Every class extended from BaseController must set the `$service` and `$request` (for validation) class names strings (Ex: FooService::class).

```
protected $service;
protected $request;
public function all();
public function find(string $id);
public function create(array $data);
public function update(string $id, array $data);
public function delete(string $id);
public function exists($id);
public function validate();
public function service(BaseServiceInterface $service = null);
```

#### `Leandrowkz\Basis\Service\BaseService`

[](#leandrowkzbasisservicebaseservice)

Every class exteded from BaseService must set `$model` class name string (Ex: FooModel::class). The create/update operations are done by using de `$fillable` array presented on `$model` class.

```
protected $model;
public function all();
public function find(string $id);
public function query($where);
public function create(array $data);
public function update(string $id, array $data);
public function delete(string $id);
public function model(string $model = null);
```

#### `Leandrowkz\Basis\Traits\AccessibleProps`

[](#leandrowkzbasistraitsaccessibleprops)

This trait adds to the target class fluent getters/setters to access any property through a method with same name. As a caveat it breaks any property visibility.

```
protected $foo = 1;
protected $bar = 2;
$this->foo(); // returns 1;
$this->bar(); // returns 2;
$this->foo(3); // sets $this->foo as 3;
$this->bar(3); // sets $this->bar as 3;
```

#### `Leandrowkz\Basis\Traits\MutatesProps`

[](#leandrowkzbasistraitsmutatesprops)

This trait adds a method that fetch all class properties and transforms all props with valid class names into objects of same class. Ex:

```
protected $customService = MyService::class; // string
$this->customService; // string
$this->mutateProps();
$this->customService; // MyService object
```

License
-------

[](#license)

This code is published under the MIT License. This means you can do almost anything with it, as long as the copyright notice and the accompanying license file is left intact.

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

[](#contributing)

Feel free to send pull requests or create issues if you come across problems or have great ideas. Any input is appreciated!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

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 ~31 days

Recently: every ~167 days

Total

25

Last Release

2149d ago

Major Versions

v0.0.1 → v1.0.02018-06-08

v1.0.2 → v2.0.02018-06-17

v2.6.3 → 3.0.02019-02-28

v3.1.0 → v4.0.02020-06-23

PHP version history (2 changes)v0.0.1PHP ^7.1

v3.1.0PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/65b00366f874bdaaaaebc04b30105064f50d851e716561cd57ffc2e6aca51020?d=identicon)[leandrowkz](/maintainers/leandrowkz)

---

Top Contributors

[![leandrowkz](https://avatars.githubusercontent.com/u/1237231?v=4)](https://github.com/leandrowkz "leandrowkz (48 commits)")

### Embed Badge

![Health badge](/badges/leandrowkz-laravel-basis/health.svg)

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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