[WIP] Setup of skeleton
This commit is contained in:
35
app/Models/Auth/Team.php
Normal file
35
app/Models/Auth/Team.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Laratrust\Models\LaratrustTeam;
|
||||
|
||||
class Team extends LaratrustTeam
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $connection = 'mysql';
|
||||
public $timestamps = false;
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('App\User');
|
||||
}
|
||||
|
||||
public function society()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Society');
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
public function scopeBySociety($query, $id)
|
||||
{
|
||||
return $query->where('society_id', $id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user