kharanenka/laravel-scope-publish

Scope for field 'publish' (bool)

1.0.0 2016-11-12 19:05 UTC

This package is auto-updated.

Last update: 2024-11-29 05:03:29 UTC


README

You can use trait in your models with "publish" field (bool)

#Installation Require this package in your composer.json and update composer.

"kharanenka/laravel-scope-publish": "1.0.*"

Usage

    
    class MyModel extend Model {
    
        use Kharanenka\Scope\PublishField;
    
        ...
    
    }
    
    $obElement = MyModel::published()->get();
    $obElement = MyModel::getPublished()->get();
    $obElement = MyModel::getByPublishedStart('2016-06-02', '>=')->get();
    $obElement = MyModel::getByPublishedStop('2016-06-02', '<')->get();