[WIP] Setup of skeleton

This commit is contained in:
Ludovic CANDELLIER
2020-03-25 00:08:27 +01:00
parent baf8e13c25
commit 36267139a1
377 changed files with 18248 additions and 26 deletions

35
app/Models/Auth/Team.php Normal file
View 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);
}
}