<?php namespace App\Models\External; use Illuminate\Database\Eloquent\Model; use App\User; class Integrations extends Model { public $table = 'external_integrations'; public function user() { return $this->belongsTo(User::class); } function scopeActive() { return $this->where('active',TRUE); } function scopeType($query,string $type) { return $query->where('type',$type); } }