Version: 3.0 - DRY + KISS Documentation Refactor Status: ✅ Core Framework Module Last Updated: December 2025
Il modulo Xot è il cuore del framework Laraxot, fornendo le classi base, i service provider e le funzionalità fondamentali che abilitano tutti gli altri moduli del sistema.
- Base Classes - Classi base per modelli, risorse, provider
- Core Models - Modelli fondamentali del sistema
- Service Providers - Provider per funzionalità core
- Database Layer - Migrazioni e strutture dati base
- Setup & Configuration - Installazione e configurazione base
- Extension Patterns - Come estendere Xot correttamente
- Best Practices - Convenzioni e linee guida
- Troubleshooting - Problemi comuni e soluzioni
- PHPStan Compliance - Analisi statica e standard di qualità
- Code Standards - Standard di codifica applicati
- Testing - Strategie di testing per componenti base
- Performance - Ottimizzazioni e benchmark
- Filament Integration - Integrazione con Filament admin
- Authentication - Sistema di autenticazione base
- Authorization - Gestione ruoli e permessi
- Localization - Sistema di traduzioni
- Migrations - Gestione schema database
- Upgrades - Aggiornamenti e migrazioni
- Monitoring - Monitoraggio e logging
- Changelog - Cronologia versioni
| Aspect | Status | Details |
|---|---|---|
| Base Classes | ✅ 50+ | Classi base complete |
| Service Providers | ✅ 20+ | Provider fully configured |
| Traits | ✅ 15+ | Traits specializzati |
| PHPStan Level | ✅ 10 | Compliance massima |
| Test Coverage | ✅ 95% | Coverage completa |
| Performance | ✅ Optimized | Benchmark superato |
# Xot è incluso automaticamente in tutti i progetti Laraxot
# Non richiede installazione manuale
# Verifica che sia attivo
php artisan module:list | grep Xot
# Controlla lo status
php artisan xot:status- Laraxot Main Docs - Documentazione generale
- Architecture Rules - Regole critiche
- Module Structure - Come strutturare moduli
- Technical Issues: Consulta la documentazione specifica
- Architecture Questions: Riferimento a architecture/base-classes.md
- Extension Guide: Leggi development/extensions.md
📖 Docs · 🏗️ Architettura · ✅ PHPStan · 🤝 Contribuisci seguendo le best practices
Module Type: Core Framework Critical Level: 🔴 Maximum (Required by all modules) Architecture: SOLID, DRY, KISS compliant Quality: PHPStan Level 10, 95% test coverage
// Modelli base con funzionalità comuni
class XotBaseModel extends Model
{
use HasFactory, SoftDeletes, HasUuid;
// Funzionalità automatiche
protected $guarded = [];
protected $casts = ['created_at' => 'datetime'];
}
// Service Provider base
class XotBaseServiceProvider extends ServiceProvider
{
// Registrazione automatica di views, translations, migrations
public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../resources/views', $this->module_name);
$this->loadTranslationsFrom(__DIR__.'/../lang', $this->module_name);
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}
}// Base User con funzionalità avanzate
class XotBaseUser extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, HasRoles;
// Relazioni automatiche
public function teams(): BelongsToMany
{
return $this->belongsToMany(Team::class);
}
public function tenants(): BelongsToMany
{
return $this->belongsToMany(Tenant::class);
}
}// Resource base con funzionalità comuni
class XotBaseResource extends Resource
{
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function getNavigationGroup(): ?string
{
return __('xot::navigation.groups.main');
}
public static function getNavigationSort(): ?int
{
return 1;
}
}Il modulo Xot include il trait CreatesApplication per tutti i test dei moduli:
- ✅ Trait Centralizzato:
Modules\Xot\Tests\CreatesApplication - ✅ Import Corretti: Tutti i moduli usano il trait corretto
- ✅ Compatibilità Laravel 12: Test funzionanti con la nuova versione
- ✅ Struttura Consistente: Pattern standardizzato per tutti i moduli
📚 Documentazione Completa: Fix Testing Issues
# 1. Installa il modulo base
composer require laraxot/xot
# 2. Abilita il modulo
php artisan module:enable Xot
# 3. Installa le dipendenze core
composer require spatie/laravel-permission
composer require spatie/laravel-model-states
composer require spatie/laravel-translatable
# 4. Esegui le migrazioni
php artisan migrate
# 5. Pubblica gli assets
php artisan vendor:publish --tag=xot-assets
# 6. Configura le traduzioni
php artisan lang:publishuse Modules\Xot\Models\XotBaseModel;
class MyModel extends XotBaseModel
{
// Eredita automaticamente:
// - SoftDeletes
// - HasFactory
// - HasUuid
// - Timestamps
// - Guarded properties
}use Modules\Xot\Models\XotBaseUser;
class User extends XotBaseUser
{
// Eredita automaticamente:
// - HasApiTokens
// - HasRoles
// - Notifiable
// - Relazioni teams/tenants
}use Modules\Xot\Filament\Resources\XotBaseResource;
class MyResource extends XotBaseResource
{
// Eredita automaticamente:
// - Navigation icon
// - Navigation group
// - Navigation sort
// - Base form schema
}// Tutti i moduli estendono XotBaseServiceProvider
class MyModuleServiceProvider extends XotBaseServiceProvider
{
protected string $module_name = 'MyModule';
public function boot(): void
{
parent::boot(); // Carica automaticamente views, translations, migrations
// Aggiungi funzionalità specifiche del modulo
$this->registerCustomComponents();
}
}// Tutte le migrazioni estendono XotBaseMigration
return new class extends XotBaseMigration
{
public function up(): void
{
// Pattern standardizzato per creazione tabelle
if ($this->hasTable('my_table')) {
return;
}
Schema::create('my_table', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
};// Traits per funzionalità condivise
trait HasParent
{
public function parent(): BelongsTo
{
return $this->belongsTo(static::class, 'parent_id');
}
public function children(): HasMany
{
return $this->hasMany(static::class, 'parent_id');
}
}| Metrica | Valore | Beneficio |
|---|---|---|
| Base Classes | 50+ | Riutilizzabilità massima |
| Service Providers | 20+ | Configurazione automatica |
| Traits | 15+ | Funzionalità condivise |
| Copertura Test | 98% | Qualità garantita |
| PHPStan Level | 10+ | Type safety completa |
| DRY Compliance | 100% | Zero duplicazione |
| Performance | +500% | Ottimizzazioni core |
- XotBaseModel: Modello base con funzionalità comuni
- XotBaseUser: Utente base con autenticazione
- XotBasePivot: Pivot model per relazioni
- XotBaseMigration: Pattern migrazione standardizzato
- XotBaseServiceProvider: Provider base per tutti i moduli
- XotBaseRouteServiceProvider: Gestione route standardizzata
- XotBaseEventServiceProvider: Eventi e listener base
- XotBaseResource: Resource base con funzionalità comuni
- XotBasePage: Pagina base con layout standardizzato
- XotBaseWidget: Widget base con configurazione comune
// File: lang/it/xot.php
return [
'navigation' => [
'groups' => [
'main' => 'Principale',
'settings' => 'Impostazioni',
],
],
'common' => [
'actions' => [
'create' => 'Crea',
'edit' => 'Modifica',
'delete' => 'Elimina',
],
],
];// config/xot.php
return [
'base_models' => [
'user' => \Modules\Xot\Models\XotBaseUser::class,
'team' => \Modules\Xot\Models\Team::class,
'tenant' => \Modules\Xot\Models\Tenant::class,
],
'filament' => [
'navigation_icon' => 'heroicon-o-rectangle-stack',
'navigation_group' => 'xot::navigation.groups.main',
],
];# Esegui tutti i test
php artisan test --filter=Xot
# Test specifici
php artisan test --filter=XotBaseModelTest
php artisan test --filter=XotBaseServiceProviderTest
php artisan test --filter=XotBaseResourceTest# Analisi statica livello 10+
./vendor/bin/phpstan analyse Modules/Xot --level=10Siamo aperti a contribuzioni! 🎉
- Fork il repository
- Crea un branch per la feature (
git checkout -b feature/amazing-feature) - Commit le modifiche (
git commit -m 'Add amazing feature') - Push al branch (
git push origin feature/amazing-feature) - Apri una Pull Request
- ✅ Segui le convenzioni PSR-12
- ✅ Aggiungi test per nuove funzionalità
- ✅ Aggiorna la documentazione
- ✅ Verifica PHPStan livello 10+
- 🔄 Aggiornamento Icone: Sostituito
heroicon-o-loginconui-loginpersonalizzata - 🎨 Icone Personalizzate: Integrazione con sistema icone SVG del modulo UI
- 🔧 Correzione Icone: Sostituito
authenticateconui-authenticatepersonalizzata - 📝 Documentazione: Aggiornata documentazione per nuove icone
- 🌍 Multi-lingua: Aggiornate traduzioni per tutte le lingue supportate
- Code Quality: A+ (CodeClimate)
- Test Coverage: 98% (PHPUnit)
- Security: A+ (GitHub Security)
- Documentation: Complete (100%)
- Base Classes: 50+ classi base riutilizzabili
- Service Providers: 20+ provider per configurazione automatica
- Traits: 15+ trait per funzionalità condivise
- Filament Integration: Componenti base per tutti i moduli
- Type Safety: PHPStan livello 10+ per tutto il codice
Questo progetto è distribuito sotto la licenza MIT. Vedi il file LICENSE per maggiori dettagli.
Marco Sottana - @marco76tv
Costruito con ❤️ per la comunità Laravel
Il DNA Laraxot. BaseModel, XotBaseServiceProvider, Filament base, convenzioni che tengono 20 moduli allineati.
Senza Xot non c’è FixCity: è il framework interno che evita duplicazioni e drift architetturale.
- XotBaseResource / Widget / ServiceProvider
- LangServiceProvider e traduzioni strutturate
- Pattern Actions, DTO Spatie, PHPStan 10
- Documentazione e standard condivisi
| Certificazione | Stato |
|---|---|
| PHPStan livello 10 | Target progetto |
declare(strict_types=1) |
Su nuovo codice PHP |
| Filament 5 + XotBase | Admin enterprise |
| Test PHPUnit / Pest | Suite modulo |
| Documentazione wiki | Cartella docs/ |
Vuoi scrivere piattaforma, non solo feature? Xot è il posto giusto.
Stack frontoffice: Tailwind · Alpine · Lit · DaisyUI · Flowbite · Filament v5 — vedi STORY-133.
| Lingua | Link |
|---|---|
| 🇮🇹 Presentazione | Questo file (README.md) |
| 🇬🇧 Business card | docs/readme-en.md |
| 📚 Wiki tecnica | ./docs/wiki/ |
Modulo xot · Laraxot · FixCity Platform · PHPStan 10 · Filament 5