Home screen improvements, testing for role, work on user/account models
This commit is contained in:
17
app/Traits/QueryCacheableConfig.php
Normal file
17
app/Traits/QueryCacheableConfig.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Set defaults of QueryCacheable
|
||||
*/
|
||||
namespace App\Traits;
|
||||
|
||||
use Rennokki\QueryCache\Traits\QueryCacheable;
|
||||
|
||||
trait QueryCacheableConfig
|
||||
{
|
||||
use QueryCacheable;
|
||||
|
||||
public $cacheFor = 3600*6; // cache time, in seconds
|
||||
protected static $flushCacheOnUpdate = TRUE;
|
||||
public $cacheDriver = 'memcached';
|
||||
}
|
@@ -16,6 +16,6 @@ trait ScopeServiceUserAuthorised
|
||||
public function scopeServiceUserAuthorised($query,User $uo)
|
||||
{
|
||||
return $query
|
||||
->whereIN('services.account_id',$uo->all_accounts()->pluck('id')->unique()->toArray());
|
||||
->whereIN('services.account_id',$uo->accounts->pluck('id'));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user