2020-07-23 12:26:10 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2020-11-09 15:26:04 +01:00
|
|
|
use Illuminate\Pagination\Paginator;
|
2020-07-23 12:26:10 +02:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2020-07-24 11:06:49 +02:00
|
|
|
use Illuminate\Support\Str;
|
2020-07-23 12:26:10 +02:00
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2020-07-27 12:49:17 +02:00
|
|
|
Str::macro('currency', static function ($price) {
|
2020-07-24 11:06:49 +02:00
|
|
|
return sprintf('%s €', number_format($price, 0, ',', ' '));
|
|
|
|
});
|
2020-07-27 16:16:27 +02:00
|
|
|
|
|
|
|
Str::macro('surface', static function ($surface) {
|
|
|
|
if (empty($surface)) {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
return sprintf('%s m²', number_format($surface, 0, ',', ' '));
|
|
|
|
});
|
2020-11-09 15:26:04 +01:00
|
|
|
Paginator::useBootstrap();
|
2020-07-23 12:26:10 +02:00
|
|
|
}
|
|
|
|
}
|