kyzegs/model
A compact Laravel package for working with Eloquent models. It provides reusable model helpers and sensible defaults that reduce boilerplate, streamline common query and attribute tasks, and keep your application's models clean, consistent, and easy to maintain.
The package is published as kyzegs/model (v0.1.0). It is an early-stage package, so treat the README and source as the source of truth rather than assuming a stable public API.
Minimal steps:
composer require kyzegs/model
composer show kyzegs/model
config/app.php.src/ for the main model/trait/service class,config/ or database/ directories for publishable assets,A sensible first use case: pick one existing Eloquent model, apply the package’s base model or trait to it, and verify normal Eloquent behaviour still works (fill, save, relationships, factories). Do not start by swapping every model in the application.
Because v0.1.0 explicitly adds Laravel 10 support, verify your app’s Laravel and PHP versions match the package’s composer.json constraints before adopting it.
Incremental adoption. Apply the package to a single model first, run your existing test suite against it, then expand. This is especially important at v0.1.0 where behaviour may change between patch releases.
Base model pattern. If the package provides a model base class, extend it in place of Illuminate\Database\Eloquent\Model:
use Kyzegs\Model\Model;
class Post extends Model
{
//
}
Keep your relationships, casts, accessors, and $fillable definitions unchanged; the package should compose with standard Eloquent rather than replace it.
Trait pattern. If the package exposes a trait, add it to existing models instead of changing their parent class. This is the lower-risk integration path and makes rollback easy.
Config publishing. If the package ships configuration, publish it and commit it so environment-specific behaviour is explicit:
php artisan vendor:publish --provider="Kyzegs\Model\ModelServiceProvider"
Testing workflow. Add a focused feature test for the first model using the package. Cover create/update, a relationship, and serialization (toArray/toJson). This catches most integration surprises early.
Factories and seeders. Confirm the package model works with Laravel factories and seeders before relying on it in local development or CI fixtures.
composer.json and read the changelog before upgrading. Expect naming and API adjustments in future releases.composer.json and src/, and make sure you are not referencing an older name in imports or provider registration.^10.0. Match this against your application’s version before installing.php artisan package:discover after installation.vendor/kyzegs/model/ over blog posts or older examples.composer show kyzegs/model, inspect vendor/kyzegs/model/composer.json, and run composer dump-autoload after changes. If behaviour differs from stock Eloquent, compare the package’s base class/trait against the Eloquent methods it overrides.How can I help you explore Laravel packages today?