Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Backpack\CRUD\CrudTrait;
- class Category extends Model
- {
- use CrudTrait;
- use \Venturecraft\Revisionable\RevisionableTrait;
- protected $table = 'category';
- protected $primaryKey = 'id';
- protected $fillable = ['name'];
- public $timestamps = false;
- public static function boot()
- {
- parent::boot();
- }
- public function subscriber()
- {
- return $this->belongsToMany('App\Models\Subscriber', 'subscriber_category', 'subscriber_id', 'category_id');
- }
- }
Add Comment
Please, Sign In to add comment