kharanenka / laravel-scope-publish by Andrey Kharanenka

Scope for field 'publish' (bool)
63
1
2
Package Data
Maintainer Username: Andrey Kharanenka
Maintainer Contact: kharanenka@gmail.com (Andrey Kharanenka)
Package Create Date: 2016-11-12
Package Last Update: 2016-11-12
Language: PHP
License: GPL-3.0
Last Refreshed: 2024-12-21 03:00:11
Package Statistics
Total Downloads: 63
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Trait PublishField

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();