Looking to hire Laravel developers? Try LaraJobs

laravel-scope-category-belongs-to maintained by kharanenka

Description
Scope for field 'category_id' (int)
Last update
2016/11/12 20:29 (dev-master)
License
Links
Downloads
40 764

Comments
comments powered by Disqus

Trait CategoryBelongsTo

You can use trait in your models with "category_id" field (int)

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


"kharanenka/laravel-scope-category-belongs-to": "1.0.*"

Usage

    
    class MyModel extend Model {
    
        use Kharanenka\Scope\CategoryBelongsTo;
    
        ...
    
    }
    
    $obElement = MyModel::getByCategory(10)->first();