for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Pratiksh\Adminetic\Traits;
use Illuminate\Support\Facades\Cache;
use Pratiksh\Adminetic\Models\Admin\Profile;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
/**
* Adminetic User.
*/
trait AdmineticUser
{
use HasPreference, HasRole, HasSlack, LogsActivity;
// Forget cache on updating or saving and deleting
public static function boot()
parent::boot();
static::saving(function () {
self::cacheKey();
});
static::deleting(function () {
}
// Cache Keys
private static function cacheKey()
Cache::has('users') ? Cache::forget('users') : '';
// Logs
protected static $logName = 'user';
public function getActivitylogOptions(): LogOptions
return LogOptions::defaults();
// Relations
public function profile()
return $this->hasOne(Profile::class);
hasOne()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->/** @scrutinizer ignore-call */ hasOne(Profile::class);