laravel-learn-bbs/app/Providers/AppServiceProvider.php
2018-01-01 20:18:33 +08:00

36 lines
696 B
PHP

<?php
namespace App\Providers;
use App\Models\Topic;
use App\Observers\TopicObserver;
use Carbon\Carbon;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Carbon::setLocale('zh');
Topic::observe(new TopicObserver());
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
}
}