laravel-vuexy-contacts/Providers/VuexyContactsServiceProvider.php

54 lines
1.4 KiB
PHP
Raw Normal View History

2025-03-05 21:11:33 -06:00
<?php
namespace Koneko\VuexyContacts\Providers;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;
use Koneko\VuexyContacts\Livewire\Contacts\{ContactIndex,ContactShow,ContactForm,ContactOffCanvasForm};
use OwenIt\Auditing\AuditableObserver;
class VuexyContactsServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Register the module's routes
$this->loadRoutesFrom(__DIR__.'/../routes/admin.php');
// Cargar vistas del paquete
$this->loadViewsFrom(__DIR__.'/../resources/views', 'vuexy-contacts');
// Register the migrations
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
// Registrar Livewire Components
$components = [
'contact-index' => ContactIndex::class,
'contact-show' => ContactShow::class,
'contact-form' => ContactForm::class,
'contact-offcanvas-form' => ContactOffCanvasForm::class,
];
foreach ($components as $alias => $component) {
Livewire::component($alias, $component);
}
// Registrar auditoría en usuarios
//User::observe(AuditableObserver::class);
}
}