Merge branch 'development' into product_linking
This commit is contained in:
commit
9dda7c429b
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
|||
/storage/*.key
|
||||
/vendor
|
||||
/storage/credit_deduction_log
|
||||
storage/debugbar
|
||||
.env
|
||||
.env.testing
|
||||
.env.backup
|
||||
|
|
|
@ -4,11 +4,14 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class Configuration extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public const CACHE_TAG = 'configuration';
|
||||
|
||||
public $primaryKey = 'key';
|
||||
|
||||
public $incrementing = false;
|
||||
|
@ -21,6 +24,15 @@ class Configuration extends Model
|
|||
'type',
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::updated(function (Configuration $configuration) {
|
||||
Cache::forget(self::CACHE_TAG .':'. $configuration->key);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param $default
|
||||
|
@ -28,7 +40,9 @@ class Configuration extends Model
|
|||
*/
|
||||
public static function getValueByKey(string $key, $default = null)
|
||||
{
|
||||
return Cache::rememberForever(self::CACHE_TAG .':'. $key, function () use ($default, $key) {
|
||||
$configuration = self::find($key);
|
||||
return $configuration ? $configuration->value : $default;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,7 +187,42 @@
|
|||
@endif
|
||||
|
||||
@if(Auth::user()->role == 'admin')
|
||||
<li class="nav-header">Admin</li>
|
||||
|
||||
<li class="nav-header">Administration</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.overview.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.overview.*')) active @endif">
|
||||
<i class="nav-icon fa fa-home"></i>
|
||||
<p>Overview</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.configurations.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.configurations.*')) active @endif">
|
||||
<i class="nav-icon fas fa-cogs"></i>
|
||||
<p>Configurations</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.settings.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.settings.*')) active @endif">
|
||||
<i class="nav-icon fas fa-tools"></i>
|
||||
<p>Settings</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.api.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.api.*')) active @endif">
|
||||
<i class="nav-icon fa fa-gamepad"></i>
|
||||
<p>Application API</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-header">Management</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.users.index')}}"
|
||||
|
@ -247,23 +282,8 @@
|
|||
{{-- </a>--}}
|
||||
{{-- </li>--}}
|
||||
|
||||
<li class="nav-header">Dashboard</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.overview.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.overview.*')) active @endif">
|
||||
<i class="nav-icon fa fa-gamepad"></i>
|
||||
<p>Overview</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.api.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.api.*')) active @endif">
|
||||
<i class="nav-icon fa fa-gamepad"></i>
|
||||
<p>Application API</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-header">Other</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.usefullinks.index')}}"
|
||||
|
@ -273,24 +293,6 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-header">Settings</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.configurations.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.configurations.*')) active @endif">
|
||||
<i class="nav-icon fas fa-cogs"></i>
|
||||
<p>Configurations</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{route('admin.settings.index')}}"
|
||||
class="nav-link @if(Request::routeIs('admin.settings.*')) active @endif">
|
||||
<i class="nav-icon fas fa-tools"></i>
|
||||
<p>Settings</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-header">Logs</li>
|
||||
|
||||
<li class="nav-item">
|
||||
|
|
|
@ -39,8 +39,10 @@
|
|||
<div class="alert alert-danger p-2 m-2">
|
||||
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Error!')}}</h5>
|
||||
<p class="pl-4">
|
||||
@if(Auth::user()->role == 'admin')
|
||||
{{__('Make sure to link your products to nodes and eggs.')}} <br>
|
||||
{{__('There has to be at least 1 valid product for server creation')}}
|
||||
@endif
|
||||
</p>
|
||||
<ul>
|
||||
@if($productCount === 0 )
|
||||
|
|
Loading…
Reference in a new issue