Looking to hire Laravel developers? Try LaraJobs

laravel-simple-scopes maintained by guifavere

Description
Simple scopes for laravel projects
Author
Last update
2023/07/19 02:50 (dev-main)
License
Links
Downloads
29

Comments
comments powered by Disqus

laravel simple scopes

Provides some useful scopes, and custom queries for laravel projects. This project was inspired in the package: laracraft-tech/laravel-date-scopes.

Installation

You can install via composer:

composer require guifavere/laravel-simple-scopes

How it works

Currently there are only scopes, and custom queries for dates. They are:

createdFrom::('2023-12-06');
createdTo::('2023-12-06');
modifiedFrom::('2023-12-06');
modifiedTo::('2023-12-06');

You can use the trait: DateScopes inside the eloquent models, or the: DateQueries for the custom query builders.

Examples:

use GuiFavere\LaravelSimpleScopes\Dates\DateScopes;

class Resource extends Model
{
    use DateScopes;
}
use GuiFavere\LaravelSimpleScopes\Dates\DateQueries;

class ResourceQueryBuilder extends Builder
{
    use DateQueries;
}

Testing

composer test

License

The MIT License (MIT).