diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 0f1ea4b..e050a4a 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -27,5 +27,12 @@ class AppServiceProvider extends ServiceProvider
Str::macro('currency', static function ($price) {
return sprintf('%s €', number_format($price, 0, ',', ' '));
});
+
+ Str::macro('surface', static function ($surface) {
+ if (empty($surface)) {
+ return '';
+ }
+ return sprintf('%s m²', number_format($surface, 0, ',', ' '));
+ });
}
}
diff --git a/resources/views/homes/view.blade.php b/resources/views/homes/view.blade.php
index 006b0a0..513120d 100644
--- a/resources/views/homes/view.blade.php
+++ b/resources/views/homes/view.blade.php
@@ -53,19 +53,61 @@
{!! nl2br($home->description) !!}
-
-
Informations :
-
Ville : {{ $home->city }}
-
Prix : {{ $home->price }}
-
Surface : {{ $home->surface }} m²
-
Nombre de pièces : {{ $home->rooms }}
-
-
-
Informations complémentaires :
-
Surface de jardin : {{ $home->garden_surface ?? '−' }}
-
Énergie : {{ $home->energy ?? '−' }}
-
GES : {{ $home->ges ?? '−' }}
-
+
+
+
+
+ Informations
+
+
+
+
+ Ville : {{ $home->city }}
+
+
+ Prix : {{ Str::currency($home->price) }}
+
+
+ Surface : {{ Str::surface($home->surface) }}
+
+
+ Pièces : {{ $home->rooms }}
+
+
+
+
+
+ Informations complémentaires
+
+
+
+
+ Jardin : {{ Str::surface($home->garden_surface) }}
+
+
+ Énergie : {{ $home->energy ?? '−' }}
+
+
+ GES : {{ $home->ges ?? '−' }}
+
@if(!empty($home->slug))
@endif
diff --git a/resources/views/public/view.blade.php b/resources/views/public/view.blade.php
index 7e55720..c38ae20 100644
--- a/resources/views/public/view.blade.php
+++ b/resources/views/public/view.blade.php
@@ -49,17 +49,59 @@
-
Informations :
-
Ville : {{ $home->city }}
-
Prix : {{ $home->price }}
-
Surface : {{ $home->surface }} m²
-
Nombre de pièces : {{ $home->rooms }}
+
+
+
+ Informations
+
+
+
+
+ Ville : {{ $home->city }}
+
+
+ Prix : {{ Str::currency($home->price) }}
+
+
+ Surface : {{ Str::surface($home->surface) }}
+
+
+ Pièces : {{ $home->rooms }}
-
Informations complémentaires :
-
Surface de jardin : {{ $home->garden_surface ?? '−' }}
-
Énergie : {{ $home->energy ?? '−' }}
-
GES : {{ $home->ges ?? '−' }}
+
+
+
+ Informations complémentaires
+
+
+
+
+ Jardin : {{ Str::surface($home->garden_surface) }}
+
+
+ Énergie : {{ $home->energy ?? '−' }}
+
+
+ GES : {{ $home->ges ?? '−' }}