share-lt/app/Providers/AppServiceProvider.php

37 lines
833 B
PHP
Raw Normal View History

<?php
namespace App\Providers;
use App\Models\Entry;
use App\Observers\EntryObserver;
use App\Models\Change;
use App\Observers\ChangeObserver;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\File;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Ensure the livewire-tmp directory exists
$livewireTmpPath = storage_path('framework/livewire-tmp');
if (!File::exists($livewireTmpPath)) {
File::makeDirectory($livewireTmpPath, 0755, true);
}
Entry::observe(EntryObserver::class);
Change::observe(ChangeObserver::class);
}
}