Skip to content

Commit

Permalink
spatie error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pratiksh404 committed Feb 25, 2022
1 parent 5e57d5c commit ad0a120
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/adminetic.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
// Plugin Adapters
'adapters' => [],

// Profile Tabs
'profile_tab' => null,

// Bouncer
'default_bouncer_credential' => 'adminetic,',
'default_bouncer_credential' => 'adminetic',
];
6 changes: 6 additions & 0 deletions src/Console/Commands/AdminStubs/Model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace App\Models\Admin;
use Illuminate\Support\Facades\Cache;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class {{modelName}} extends Model
{
Expand Down Expand Up @@ -34,4 +35,9 @@ class {{modelName}} extends Model

// Logs
protected static $logName = '{{modelNameSingularLowerCase}}';

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults();
}
}
6 changes: 6 additions & 0 deletions src/Models/Admin/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class Permission extends Model
{
Expand Down Expand Up @@ -41,6 +42,11 @@ private static function cacheKey()
// Logs
protected static $logName = 'permission';

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults();
}

// Relations
public function role()
{
Expand Down
6 changes: 6 additions & 0 deletions src/Models/Admin/Preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class Preference extends Model
{
Expand Down Expand Up @@ -36,6 +37,11 @@ private static function cacheKey()
// Logs
protected static $logName = 'preference';

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults();
}

// Casts
public $casts = [
'roles' => 'array',
Expand Down
7 changes: 7 additions & 0 deletions src/Models/Admin/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class Role extends Model
{
Expand Down Expand Up @@ -50,6 +51,12 @@ private static function cacheKey()
// Logs
protected static $logName = 'role';


public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults();
}

// Relations
public function permissions()
{
Expand Down
6 changes: 6 additions & 0 deletions src/Models/Admin/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class Setting extends Model
{
Expand Down Expand Up @@ -35,6 +36,11 @@ private static function cacheKey()
// Logs
protected static $logName = 'setting';

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults();
}

// Casts
public $casts = [
'setting_custom' => 'array',
Expand Down

0 comments on commit ad0a120

Please sign in to comment.