More base setup and integration with AdminLTE

This commit is contained in:
Deon George
2016-10-21 01:40:52 +11:00
parent 84ae365676
commit 3f54233c39
1495 changed files with 841197 additions and 20908 deletions

29
app/Scopes/AddSiteId.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace App\Scopes;
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Config;
class AddSiteId implements Scope
{
/**
* Apply the scope to a given Eloquent query builder.
*
* @param \Illuminate\Database\Eloquent\Builder $builder
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function apply(Builder $builder, Model $model)
{
if (! in_array($model->table(),['account','setup']))
dd(__METHOD__,$model,$builder);
$so = Config::get('SITE_SETUP');
if (! $so instanceOf Setup OR ! $so->exists)
return;
$builder->where('site_id', '=', $so->id);
}
}