Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Linter Laravel Package

memio/linter

Memio Linter provides a set of Memio Validator constraints to lint Memio models for syntax and structural issues. Use it standalone or as part of the Memio code generator to validate arguments, methods, contracts, objects, files, and collections.

View on GitHub
Deep Wiki
Context7

Memio's linter, a set of constraint that check models for syntax errors

Frequently asked questions about Linter
Can I use Memio Linter to validate Eloquent models in Laravel without adopting Memio’s full ecosystem?
No, this package is tightly coupled to Memio’s model system. Eloquent models won’t work without rewriting constraints to target Laravel’s reflection system or custom model traits, which isn’t supported out of the box.
What Laravel version does Memio Linter support?
The package requires PHP 7.2+, which aligns with Laravel 8+. However, its constraints are designed for Memio’s models, not Laravel’s Eloquent, so version compatibility alone doesn’t guarantee usability.
How do I install Memio Linter in a Laravel project?
Run `composer require memio/linter:^3.0`, but note this only installs the constraints. You’ll also need Memio’s validator and model layers to use it, which aren’t Laravel-native.
Are there alternatives to Memio Linter for Laravel model validation?
Yes. For static analysis, use PHPStan or Psalm with custom rules. For runtime validation, leverage Eloquent’s built-in rules or Laravel’s Form Request validation. Memio Linter’s constraints would need significant adaptation to fit Laravel.
Can I integrate Memio Linter into Laravel’s CI/CD pipeline?
Integration is possible but complex. You’d need custom scripts to bridge Memio’s validation system with Laravel’s workflows (e.g., GitHub Actions), and it requires adopting Memio’s tooling like Docker and phpspec.
What constraints does Memio Linter enforce that PHPStan/Psalm might miss?
Constraints like `MethodCannotBeAbstractAndHaveBody` or `ContractMethodsCanOnlyBePublic` are opinionated checks for Memio’s model contracts. PHPStan/Psalm can replicate these with custom rules, but they’re not natively supported.
Will Memio Linter work with custom Laravel model layers (e.g., DTOs, API resources)?
Only if you rewrite constraints to target your custom model classes instead of Memio’s `Model` interface. This requires manual effort and isn’t plug-and-play.
Does Memio Linter support runtime validation like Laravel’s Form Requests?
No, it’s designed for build-time validation via Memio’s code generation pipeline. Laravel typically uses runtime validation (e.g., Eloquent rules) or static analysis tools like PHPStan.
What’s the overhead of adopting Memio Linter in a Laravel project?
High. It introduces dependencies like Docker, PHPStan, Rector, and phpspec, which may conflict with Laravel’s simpler toolchain (e.g., `phpstan:baseline`, `pint`). Onboarding friction is significant unless you’re already using Memio.
Can I extract individual constraints (e.g., `MethodCannotBeAbstractAndHaveBody`) for Laravel?
Technically yes, but you’d need to rewrite them to use Laravel’s reflection utilities or custom traits. This could duplicate effort if similar checks already exist in PHPStan/Psalm.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor