Changes
This commit is contained in:
@@ -240,6 +240,12 @@ class FormBuilderItem
|
||||
Builder\Block::make('captcha')
|
||||
->label('reCaptcha')
|
||||
->schema([
|
||||
TextInput::make('title_field')
|
||||
->label('Заголовок поля')
|
||||
->live(onBlur: true)
|
||||
->default('Капча')
|
||||
->disabled(true)
|
||||
->dehydrated(true),
|
||||
Forms\Components\Hidden::make('name_field')->required()->default(Str::slug('reCaptcha') . Carbon::now()->timestamp),
|
||||
Section::make('Настройка')
|
||||
->collapsed()
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\MainSection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class MainSectionObserver
|
||||
{
|
||||
public function created(MainSection $mainSection): void
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
/**
|
||||
* Очистка кеша при обновлении MainSection.
|
||||
*
|
||||
* @param MainSection $mainSection
|
||||
* @return void
|
||||
*/
|
||||
public function updated(MainSection $mainSection)
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка кеша при удалении MainSection.
|
||||
*
|
||||
* @param MainSection $mainSection
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(MainSection $mainSection)
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class PageObserver
|
||||
*/
|
||||
public function created(Page $page): void
|
||||
{
|
||||
//
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,6 +22,7 @@ class PageObserver
|
||||
{
|
||||
$cacheKey = 'page_' . md5($page->path);
|
||||
Cache::forget($cacheKey);
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,6 +32,7 @@ class PageObserver
|
||||
{
|
||||
$cacheKey = 'page_' . md5($page->path);
|
||||
Cache::forget($cacheKey);
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\SubSection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class SubSectionObserver
|
||||
{
|
||||
public function created(SubSection $subSection): void
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
/**
|
||||
* Очистка кеша при обновлении SubSection.
|
||||
*
|
||||
* @param SubSection $subSection
|
||||
* @return void
|
||||
*/
|
||||
public function updated(SubSection $subSection)
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка кеша при удалении SubSection.
|
||||
*
|
||||
* @param SubSection $subSection
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(SubSection $subSection)
|
||||
{
|
||||
Cache::forget('navigation');
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,14 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\MainSection;
|
||||
use App\Models\Page;
|
||||
use App\Models\Post;
|
||||
use App\Models\SubSection;
|
||||
use App\Observers\MainSectionObserver;
|
||||
use App\Observers\PageObserver;
|
||||
use App\Observers\PostObserver;
|
||||
use App\Observers\SubSectionObserver;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Facades\Filament;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -33,6 +37,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
setlocale(LC_TIME, 'ru_RU.UTF-8');
|
||||
Page::observe(PageObserver::class);
|
||||
Post::observe(PostObserver::class);
|
||||
MainSection::observe(MainSectionObserver::class);
|
||||
SubSection::observe(SubSectionObserver::class);
|
||||
Carbon::setLocale(config('app.locale'));
|
||||
Model::preventLazyLoading(!app()->isProduction());
|
||||
// URL::forceScheme('https');
|
||||
|
||||
Reference in New Issue
Block a user