PHPackages                             codewiser/laravel - 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. codewiser/laravel

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

codewiser/laravel
=================

Packages I might include to every Laravel application

v1.1.10(1y ago)0418MITPHPPHP ^8.1

Since Sep 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/C0deWiser/laravel)[ Packagist](https://packagist.org/packages/codewiser/laravel)[ RSS](/packages/codewiser-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (16)Versions (18)Used By (0)

Laravel Swiss-knife
===================

[](#laravel-swiss-knife)

Packages I might include to every Laravel application

Structures
----------

[](#structures)

Structure is an `array` or `json` attributes with structured interface.

For example:

```
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\Casts\AsStringable;
use Illuminate\Support\Stringable;

/**
 * @property null|Stringable $first_name
 * @property null|Stringable $second_name
 * @property null|Stringable $family_name
 */
class Username extends Pivot
{
    protected function casts(): array
    {
        return [
            'first_name' => AsStringable::class,
            'second_name' => AsStringable::class,
            'family_name' => AsStringable::class,
        ];
    }
}
```

Apply `Username` struct to `User` model:

```
use Illuminate\Database\Eloquent\Model;
use Codewiser\Database\Eloquent\Casts\AsStruct;

/**
 * @property null|Username $name
 */
class User extends Model
{
    protected function casts(): array
    {
        return [
            'name' => AsStruct::using(Username::class)
        ];
    }
}
```

You can make it not-nullable:

```
use Illuminate\Database\Eloquent\Model;
use Codewiser\Database\Eloquent\Casts\AsStruct;

/**
 * @property Username $name
 */
class User extends Model
{
    protected function casts(): array
    {
        return [
            'name' => AsStruct::using(Username::class, required: true)
        ];
    }
}
```

Structure collections
---------------------

[](#structure-collections)

The same way, you may cast collections of custom structs:

```
use Codewiser\Database\Eloquent\Casts\AsStructCollection;
use \Illuminate\Support\Collection;

/**
 * @property null|Collection $contacts_1
 * @property null|ContactCollection $contacts_2
 * @property Collection $contacts_3
 */
class User extends Model
{
    protected function casts(): array
    {
        return [
            'contacts_1' => AsStructCollection::using(Contact::class),
            'contacts_2' => AsStructCollection::using(ContactCollection::class, Contact::class),
            'contacts_3' => AsStructCollection::using(Contact::class, required: true),
        ];
    }
}
```

Passive SoftDeletes
-------------------

[](#passive-softdeletes)

`PassiveSoftDeletes` traits works alike `SoftDeletes`, but it is disabled by default.

Also, it counts record as trashed only then `deleted_at` is reached. So you may trash records in perspective.

It comes with `\Codewiser\Database\Eloquent\Traits\HasDeletedAt` trait, that is applicable to custom builders with the same behavior.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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

Total

17

Last Release

444d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce23eaf7ae48d79d2b07efc83ff7cecb2664f428bd531b167b90169423f1453d?d=identicon)[Cellard](/maintainers/Cellard)

---

Top Contributors

[![Cellard](https://avatars.githubusercontent.com/u/1220316?v=4)](https://github.com/Cellard "Cellard (28 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cerbero/laravel-enum

Laravel package to supercharge enum functionalities.

18989.6k](/packages/cerbero-laravel-enum)[link1st/laravel-easemob

环信即时通讯laravel包开发，用于环信用户、群、聊天室等功能

456.6k](/packages/link1st-laravel-easemob)

PHPackages © 2026

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