Download the PHP package safemood/laravel-magic-scopes without Composer
On this page you can find all versions of the php package safemood/laravel-magic-scopes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download safemood/laravel-magic-scopes
More information about safemood/laravel-magic-scopes
Files in safemood/laravel-magic-scopes
Package laravel-magic-scopes
Short Description A Laravel package that automatically generates dynamic query scopes from field names and types
License MIT
Homepage https://github.com/safemood/laravel-magic-scopes
Informations about the package laravel-magic-scopes
Laravel Magic Scopes
Laravel Magic Scopes auto-generates query scopes for your models — no code needed, just magic 🔮.
Table of Contents
- Laravel Magic Scopes
- Table of Contents
- Installation
- Usage
- What It can do
- Boolean Field Scopes
- Enum Field Scopes
- Foreign Key Scopes
- JSON Field Scopes
- Number Field Scopes
- Date Field Scopes
- Extend
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Simply use the HasMagicScopes trait in your Eloquent model:
What It can do
Boolean Field Scopes
Enum Field Scopes
Foreign Key Scopes
JSON Field Scopes
Number Field Scopes
Date Field Scopes
Extend
You can create your own custom scope resolver if you want to control how scopes are resolved from method names.
Here's how to create a custom ScopeResolver:
⚠️ Important:
Custom resolvers should not match the same method as another resolver.
If multiple resolvers match, an exception is thrown to avoid conflicts.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Khalil Bouzidi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-magic-scopes with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0|^12.0