You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
860 B

<?php
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
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, ',', ' '));
});
Paginator::useBootstrap();
}
}