for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of Gitamin.
*
* Copyright (C) 2015-2016 The Gitamin Team
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Gitamin\Models;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Model;
class Group extends ProjectNamespace
{
protected $table = 'namespaces';
/**
* Finds all groups.
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
public function scopeIsGroup($query)
return $query->where('type', 'group');
}
* Finds all my namespaces.
public function scopeMine($query)
return $query->where('owner_id', Auth::user()->id);