diff --git a/app/Http/Controllers/ImmobiliController.php b/app/Http/Controllers/ImmobiliController.php new file mode 100644 index 0000000..c671912 --- /dev/null +++ b/app/Http/Controllers/ImmobiliController.php @@ -0,0 +1,117 @@ + Immobili::all() + ]); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + return view('affitti.immobili.create'); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + $data = $request->validate([ + 'indirizzo' => 'nullable|string|max:255', + 'citta' => 'nullable|string|max:255', + 'cap' => 'nullable|string|max:20', + 'provincia' => 'nullable|string|max:255', + 'nazione' => 'nullable|string|max:255', + 'descrizione' => 'nullable|string|max:1000', + 'categoria' => 'nullable|string|max:255', + 'tipologia' => 'nullable|string|max:255', + 'stato' => 'nullable|string|max:255', + 'classe_energetica' => 'nullable|string|max:50', + 'superficie' => 'nullable|string|max:50', + 'vani' => 'nullable|string|max:50', + 'bagni' => 'nullable|string|max:50', + 'camere' => 'nullable|string|max:50', + 'piano' => 'nullable|string|max:50', + 'ascensore' => 'nullable|string|max:50', + 'riscaldamento' => 'nullable|string|max:50', + 'condizionatore' => 'nullable|string|max:50', + 'giardino' => 'nullable|string|max:50', + 'posto_auto' => 'nullable|string|max:50', + 'garage' => 'nullable|string|max:50', + 'balcone' => 'nullable|string|max:50', + 'terrazzo' => 'nullable|string|max:50', + 'cantina' => 'nullable|string|max:50', + 'arredamento' => 'nullable|string|max:50', + 'spese_condominiali' => 'nullable|string|max:100', + 'anno_costruzione' => 'nullable|string|max:4', + 'prezzo' => 'nullable|string|max:100', + 'disponibilita' => 'nullable|string|max:255', + 'note' => 'nullable|string|max:2000', + 'fibra-ottica' => 'nullable|string|max:50', + 'internet' => 'nullable|string|max:50', + ]); + Immobili::create($data); + return redirect()->route('immobili')->with('success', 'Immobile creato con successo.'); + } + + /** + * Display the specified resource. + */ + public function show(Immobili $immobili) + { + // + $immobile=Immobili::find($immobili->id); + return view('affitti.immobili.show',compact('immobile')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(Immobili $immobili) + { + // + + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Immobili $immobili) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Immobili $immobili) + { + // + $immobile=Immobili::find($immobili->id); + $immobile->delete(); + return redirect()->route('immobili')->with('success', 'Immobile eliminato con successo.'); + } + + public function associaContratto(Immobili $immobili) + { + $immobile=Immobili::find($immobili); + return view('affitti.immobili.assegna-contratto',[compact('immobile'),'id'=>$immobili]); + } +} diff --git a/app/Models/Immobili.php b/app/Models/Immobili.php new file mode 100644 index 0000000..c888220 --- /dev/null +++ b/app/Models/Immobili.php @@ -0,0 +1,45 @@ + 'fas fa-fw fa-car', 'can' => ['automobili'], ], - + [ 'text' => 'Affitti', + 'url' => '#', + 'icon' => 'fas fa-fw fa-home', + 'submenu' => [ + [ + 'text' => 'Immobili', + 'url' => 'admin/affitti/immobili', + 'icon' => 'fas fa-fw fa-wine-bottle', + 'can' => ['affitti'], + ], + [ + 'text' => 'Contratti di locazione', + 'url' => 'admin/affitti/locazioni', + 'icon' => 'fas fa-fw fa-tags', + 'can' => ['affitti'], + ], + [ + 'text' => 'Scadenze', + 'url' => 'admin/affitti/scadenze', + 'icon' => 'fas fa-fw fa-wallet', + 'can' => ['affitti'], + ], + [ + 'text' => 'Spese condominiali', + 'url' => 'admin/affitti/spese', + 'icon' => 'fas fa-fw fa-tags', + 'can' => ['affitti'], + ], + [ + 'text' => 'Ripartizione spese', + 'url' => 'admin/affitti/ripartizioni', + 'icon' => 'fas fa-fw fa-wallet', + 'can' => ['affitti'], + ], + ], + ], ['header' => 'GESTIONE PIM', 'can' => ['contatti','tasks','appuntamenti','meetingroom'], ], diff --git a/database/migrations/2025_09_26_115029_create_immobilis_table.php b/database/migrations/2025_09_26_115029_create_immobilis_table.php new file mode 100644 index 0000000..826e5b2 --- /dev/null +++ b/database/migrations/2025_09_26_115029_create_immobilis_table.php @@ -0,0 +1,59 @@ +id(); + $table->timestamps(); + $table->string('indirizzo')->nullable(); + $table->string('citta')->nullable(); + $table->string('cap')->nullable(); + $table->string('provincia')->nullable(); + $table->string('nazione')->nullable(); + $table->string('descrizione')->nullable(); + $table->string('categoria')->nullable(); + $table->string('tipologia')->nullable(); + $table->string('stato')->nullable(); + $table->string('classe_energetica')->nullable(); + $table->string('superficie')->nullable(); + $table->string('vani')->nullable(); + $table->string('bagni')->nullable(); + $table->string('camere')->nullable(); + $table->string('piano')->nullable(); + $table->string('ascensore')->nullable(); + $table->string('riscaldamento')->nullable(); + $table->string('condizionatore')->nullable(); + $table->string('giardino')->nullable(); + $table->string('posto_auto')->nullable(); + $table->string('garage')->nullable(); + $table->string('balcone')->nullable(); + $table->string('terrazzo')->nullable(); + $table->string('cantina')->nullable(); + $table->string('arredamento')->nullable(); + $table->string('spese_condominiali')->nullable(); + $table->string('anno_costruzione')->nullable(); + $table->string('prezzo')->nullable(); + $table->string('disponibilita')->nullable(); + $table->string('note')->nullable(); + $table->string('fibra-ottica')->nullable(); + $table->string('internet')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('immobilis'); + } +}; diff --git a/resources/views/affitti/immobili/assegna-contratto.blade.php b/resources/views/affitti/immobili/assegna-contratto.blade.php new file mode 100644 index 0000000..00b2ad5 --- /dev/null +++ b/resources/views/affitti/immobili/assegna-contratto.blade.php @@ -0,0 +1,25 @@ +@extends('adminlte::page') + +@section('title', 'Assegna Contratto') +@section('content_header') +
Elenco immobili
+ Nuovo Immobile + +ID | +Indirizzo | +Città | +Stato | +Azioni | +
---|---|---|---|---|
{{ $immobile->id }} | +{{ $immobile->indirizzo }} | +{{ $immobile->citta }} | +{{ $immobile->stato }} | ++ Visualizza + Modifica + + | +
Indirizzo: {{ $immobile->indirizzo }}
+Tipologia: {{ $immobile->tipologia }}
+Superficie: {{ $immobile->superficie }} m²
+ + +