35 lines
766 B
PHP
35 lines
766 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
Schema::defaultStringLength(191);
|
|
Carbon::macro('shorterDiffForHumans', static function () {
|
|
$diff = self::this()->diffForHumans(...func_get_args());
|
|
return strtr($diff, [ 'second' => 's', 'minute' => 'm', 'hour' => 'h', 'days'=>'d','months'=>'m', 'years'=>'y']);
|
|
});
|
|
}
|
|
}
|