rzaglinskiy

Untitled

Jan 18th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Model;
  6. use Backpack\CRUD\CrudTrait;
  7.  
  8. class Category extends Model
  9. {
  10.     use CrudTrait;
  11.     use \Venturecraft\Revisionable\RevisionableTrait;
  12.  
  13.     protected $table = 'category';
  14.  
  15.     protected $primaryKey = 'id';
  16.  
  17.     protected $fillable = ['name'];
  18.  
  19.     public $timestamps = false;
  20.  
  21.     public static function boot()
  22.     {
  23.         parent::boot();
  24.     }
  25.  
  26.     public function subscriber()
  27.     {
  28.         return $this->belongsToMany('App\Models\Subscriber', 'subscriber_category', 'subscriber_id', 'category_id');
  29.     }
  30.  
  31. }
Add Comment
Please, Sign In to add comment